Add support for PT_GNU_STACK.
[deliverable/binutils-gdb.git] / gold / testsuite / testfile.cc
1 // testfile.cc -- Dummy ELF objects for testing purposes.
2
3 // Copyright 2006, 2007 Free Software Foundation, Inc.
4 // Written by Ian Lance Taylor <iant@google.com>.
5
6 // This file is part of gold.
7
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 3 of the License, or
11 // (at your option) any later version.
12
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 // MA 02110-1301, USA.
22
23 #include "gold.h"
24
25 #include "target.h"
26 #include "target-select.h"
27
28 #include "test.h"
29 #include "testfile.h"
30
31 namespace gold_testsuite
32 {
33
34 using namespace gold;
35
36 // A Target used for testing purposes.
37
38 template<int size, bool big_endian>
39 class Target_test : public Sized_target<size, big_endian>
40 {
41 public:
42 Target_test()
43 : Sized_target<size, big_endian>(&test_target_info)
44 { }
45
46 void
47 scan_relocs(const General_options&, Symbol_table*, Layout*,
48 Sized_relobj<size, big_endian>*, unsigned int,
49 unsigned int, const unsigned char*, size_t, size_t,
50 const unsigned char*, Symbol**)
51 { ERROR("call to Target_test::scan_relocs"); }
52
53 void
54 relocate_section(const Relocate_info<size, big_endian>*, unsigned int,
55 const unsigned char*, size_t, unsigned char*,
56 typename elfcpp::Elf_types<size>::Elf_Addr, off_t)
57 { ERROR("call to Target_test::relocate_section"); }
58
59 static const Target::Target_info test_target_info;
60 };
61
62 template<int size, bool big_endian>
63 const Target::Target_info Target_test<size, big_endian>::test_target_info =
64 {
65 size, // size
66 big_endian, // is_big_endian
67 static_cast<elfcpp::EM>(0xffff), // machine_code
68 false, // has_make_symbol
69 false, // has_resolve
70 false, // has_code_fill
71 false, // is_default_stack_executable
72 "/dummy", // dynamic_linker
73 0x08000000, // default_text_segment_address
74 0x1000, // abi_pagesize
75 0x1000 // common_pagesize
76 };
77
78 // The test targets.
79
80 #ifdef HAVE_TARGET_32_LITTLE
81 Target_test<32, false> target_test_32_little;
82 #endif
83
84 #ifdef HAVE_TARGET_32_BIG
85 Target_test<32, true> target_test_32_big;
86 #endif
87
88 #ifdef HAVE_TARGET_64_LITTLE
89 Target_test<64, false> target_test_64_little;
90 #endif
91
92 #ifdef HAVE_TARGET_64_BIG
93 Target_test<64, true> target_test_64_big;
94 #endif
95
96 // A pointer to the test targets. This is used in CHECKs.
97
98 #ifdef HAVE_TARGET_32_LITTLE
99 Target* target_test_pointer_32_little = &target_test_32_little;
100 #endif
101
102 #ifdef HAVE_TARGET_32_BIG
103 Target* target_test_pointer_32_big = &target_test_32_big;
104 #endif
105
106 #ifdef HAVE_TARGET_64_LITTLE
107 Target* target_test_pointer_64_little = &target_test_64_little;
108 #endif
109
110 #ifdef HAVE_TARGET_64_BIG
111 Target* target_test_pointer_64_big = &target_test_64_big;
112 #endif
113
114 // Select the test targets.
115
116 template<int size, bool big_endian>
117 class Target_selector_test : public Target_selector
118 {
119 public:
120 Target_selector_test()
121 : Target_selector(0xffff, size, big_endian)
122 { }
123
124 Target*
125 recognize(int, int, int)
126 {
127 if (size == 32)
128 {
129 if (!big_endian)
130 {
131 #ifdef HAVE_TARGET_32_LITTLE
132 return &target_test_32_little;
133 #endif
134 }
135 else
136 {
137 #ifdef HAVE_TARGET_32_BIG
138 return &target_test_32_big;
139 #endif
140 }
141 }
142 else
143 {
144 if (!big_endian)
145 {
146 #ifdef HAVE_TARGET_64_LITTLE
147 return &target_test_64_little;
148 #endif
149 }
150 else
151 {
152 #ifdef HAVE_TARGET_64_BIG
153 return &target_test_64_big;
154 #endif
155 }
156 }
157
158 return NULL;
159 }
160 };
161
162 // Register the test target selectors. These don't need to be
163 // conditionally compiled, as they will return NULL if there is no
164 // support for them.
165
166 Target_selector_test<32, false> target_selector_test_32_little;
167 Target_selector_test<32, true> target_selector_test_32_big;
168 Target_selector_test<64, false> target_selector_test_64_little;
169 Target_selector_test<64, true> target_selector_test_64_big;
170
171 // A simple ELF object with one empty section, named ".test" and one
172 // globally visible symbol named "test".
173
174 const unsigned char test_file_1_32_little[] =
175 {
176 // Ehdr
177 // EI_MAG[0-3]
178 0x7f, 'E', 'L', 'F',
179 // EI_CLASS: 32 bit.
180 1,
181 // EI_DATA: little endian
182 1,
183 // EI_VERSION
184 1,
185 // EI_OSABI
186 0,
187 // EI_ABIVERSION
188 0,
189 // EI_PAD
190 0, 0, 0, 0, 0, 0, 0,
191 // e_type: ET_REL
192 1, 0,
193 // e_machine: a magic value used for testing.
194 0xff, 0xff,
195 // e_version
196 1, 0, 0, 0,
197 // e_entry
198 0, 0, 0, 0,
199 // e_phoff
200 0, 0, 0, 0,
201 // e_shoff: starts right after file header
202 52, 0, 0, 0,
203 // e_flags
204 0, 0, 0, 0,
205 // e_ehsize
206 52, 0,
207 // e_phentsize
208 32, 0,
209 // e_phnum
210 0, 0,
211 // e_shentsize
212 40, 0,
213 // e_shnum: dummy, .test, .symtab, .strtab, .shstrtab
214 5, 0,
215 // e_shstrndx
216 4, 0,
217
218 // Offset 52
219 // Shdr 0: dummy entry
220 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
221 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
222 0, 0, 0, 0, 0, 0, 0, 0,
223
224 // Offset 92
225 // Shdr 1: .test
226 // sh_name: after initial null
227 1, 0, 0, 0,
228 // sh_type: SHT_PROGBITS
229 1, 0, 0, 0,
230 // sh_flags: SHF_ALLOC
231 2, 0, 0, 0,
232 // sh_addr
233 0, 0, 0, 0,
234 // sh_offset: after file header + 5 section headers
235 252, 0, 0, 0,
236 // sh_size
237 0, 0, 0, 0,
238 // sh_link
239 0, 0, 0, 0,
240 // sh_info
241 0, 0, 0, 0,
242 // sh_addralign
243 1, 0, 0, 0,
244 // sh_entsize
245 0, 0, 0, 0,
246
247 // Offset 132
248 // Shdr 2: .symtab
249 // sh_name: 1 null byte + ".test\0"
250 7, 0, 0, 0,
251 // sh_type: SHT_SYMTAB
252 2, 0, 0, 0,
253 // sh_flags
254 0, 0, 0, 0,
255 // sh_addr
256 0, 0, 0, 0,
257 // sh_offset: after file header + 5 section headers + empty section
258 252, 0, 0, 0,
259 // sh_size: two symbols: dummy symbol + test symbol
260 32, 0, 0, 0,
261 // sh_link: to .strtab
262 3, 0, 0, 0,
263 // sh_info: one local symbol, the dummy symbol
264 1, 0, 0, 0,
265 // sh_addralign
266 4, 0, 0, 0,
267 // sh_entsize: size of symbol
268 16, 0, 0, 0,
269
270 // Offset 172
271 // Shdr 3: .strtab
272 // sh_name: 1 null byte + ".test\0" + ".symtab\0"
273 15, 0, 0, 0,
274 // sh_type: SHT_STRTAB
275 3, 0, 0, 0,
276 // sh_flags
277 0, 0, 0, 0,
278 // sh_addr
279 0, 0, 0, 0,
280 // sh_offset: after .symtab section. 284 == 0x11c
281 0x1c, 0x1, 0, 0,
282 // sh_size: 1 null byte + "test\0"
283 6, 0, 0, 0,
284 // sh_link
285 0, 0, 0, 0,
286 // sh_info
287 0, 0, 0, 0,
288 // sh_addralign
289 1, 0, 0, 0,
290 // sh_entsize
291 0, 0, 0, 0,
292
293 // Offset 212
294 // Shdr 4: .shstrtab
295 // sh_name: 1 null byte + ".test\0" + ".symtab\0" + ".strtab\0"
296 23, 0, 0, 0,
297 // sh_type: SHT_STRTAB
298 3, 0, 0, 0,
299 // sh_flags
300 0, 0, 0, 0,
301 // sh_addr
302 0, 0, 0, 0,
303 // sh_offset: after .strtab section. 290 == 0x122
304 0x22, 0x1, 0, 0,
305 // sh_size: all section names
306 33, 0, 0, 0,
307 // sh_link
308 0, 0, 0, 0,
309 // sh_info
310 0, 0, 0, 0,
311 // sh_addralign
312 1, 0, 0, 0,
313 // sh_entsize
314 0, 0, 0, 0,
315
316 // Offset 252
317 // Contents of .symtab section
318 // Symbol 0
319 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
320
321 // Offset 268
322 // Symbol 1
323 // st_name
324 1, 0, 0, 0,
325 // st_value
326 0, 0, 0, 0,
327 // st_size
328 0, 0, 0, 0,
329 // st_info: STT_NOTYPE, STB_GLOBAL
330 0x10,
331 // st_other
332 0,
333 // st_shndx: In .test
334 1, 0,
335
336 // Offset 284
337 // Contents of .strtab section
338 '\0',
339 't', 'e', 's', 't', '\0',
340
341 // Offset 290
342 // Contents of .shstrtab section
343 '\0',
344 '.', 't', 'e', 's', 't', '\0',
345 '.', 's', 'y', 'm', 't', 'a', 'b', '\0',
346 '.', 's', 't', 'r', 't', 'a', 'b', '\0',
347 '.', 's', 'h', 's', 't', 'r', 't', 'a', 'b', '\0'
348 };
349
350 const unsigned int test_file_1_size_32_little = sizeof test_file_1_32_little;
351
352 // 32-bit big-endian version of test_file_1_32_little.
353
354 const unsigned char test_file_1_32_big[] =
355 {
356 // Ehdr
357 // EI_MAG[0-3]
358 0x7f, 'E', 'L', 'F',
359 // EI_CLASS: 32 bit.
360 1,
361 // EI_DATA: big endian
362 2,
363 // EI_VERSION
364 1,
365 // EI_OSABI
366 0,
367 // EI_ABIVERSION
368 0,
369 // EI_PAD
370 0, 0, 0, 0, 0, 0, 0,
371 // e_type: ET_REL
372 0, 1,
373 // e_machine: a magic value used for testing.
374 0xff, 0xff,
375 // e_version
376 0, 0, 0, 1,
377 // e_entry
378 0, 0, 0, 0,
379 // e_phoff
380 0, 0, 0, 0,
381 // e_shoff: starts right after file header
382 0, 0, 0, 52,
383 // e_flags
384 0, 0, 0, 0,
385 // e_ehsize
386 0, 52,
387 // e_phentsize
388 0, 32,
389 // e_phnum
390 0, 0,
391 // e_shentsize
392 0, 40,
393 // e_shnum: dummy, .test, .symtab, .strtab, .shstrtab
394 0, 5,
395 // e_shstrndx
396 0, 4,
397
398 // Offset 52
399 // Shdr 0: dummy entry
400 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
401 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
402 0, 0, 0, 0, 0, 0, 0, 0,
403
404 // Offset 92
405 // Shdr 1: .test
406 // sh_name: after initial null
407 0, 0, 0, 1,
408 // sh_type: SHT_PROGBITS
409 0, 0, 0, 1,
410 // sh_flags: SHF_ALLOC
411 0, 0, 0, 2,
412 // sh_addr
413 0, 0, 0, 0,
414 // sh_offset: after file header + 5 section headers
415 0, 0, 0, 252,
416 // sh_size
417 0, 0, 0, 0,
418 // sh_link
419 0, 0, 0, 0,
420 // sh_info
421 0, 0, 0, 0,
422 // sh_addralign
423 0, 0, 0, 1,
424 // sh_entsize
425 0, 0, 0, 0,
426
427 // Offset 132
428 // Shdr 2: .symtab
429 // sh_name: 1 null byte + ".test\0"
430 0, 0, 0, 7,
431 // sh_type: SHT_SYMTAB
432 0, 0, 0, 2,
433 // sh_flags
434 0, 0, 0, 0,
435 // sh_addr
436 0, 0, 0, 0,
437 // sh_offset: after file header + 5 section headers + empty section
438 0, 0, 0, 252,
439 // sh_size: two symbols: dummy symbol + test symbol
440 0, 0, 0, 32,
441 // sh_link: to .strtab
442 0, 0, 0, 3,
443 // sh_info: one local symbol, the dummy symbol
444 0, 0, 0, 1,
445 // sh_addralign
446 0, 0, 0, 4,
447 // sh_entsize: size of symbol
448 0, 0, 0, 16,
449
450 // Offset 172
451 // Shdr 3: .strtab
452 // sh_name: 1 null byte + ".test\0" + ".symtab\0"
453 0, 0, 0, 15,
454 // sh_type: SHT_STRTAB
455 0, 0, 0, 3,
456 // sh_flags
457 0, 0, 0, 0,
458 // sh_addr
459 0, 0, 0, 0,
460 // sh_offset: after .symtab section. 284 == 0x11c
461 0, 0, 0x1, 0x1c,
462 // sh_size: 1 null byte + "test\0"
463 0, 0, 0, 6,
464 // sh_link
465 0, 0, 0, 0,
466 // sh_info
467 0, 0, 0, 0,
468 // sh_addralign
469 0, 0, 0, 1,
470 // sh_entsize
471 0, 0, 0, 0,
472
473 // Offset 212
474 // Shdr 4: .shstrtab
475 // sh_name: 1 null byte + ".test\0" + ".symtab\0" + ".strtab\0"
476 0, 0, 0, 23,
477 // sh_type: SHT_STRTAB
478 0, 0, 0, 3,
479 // sh_flags
480 0, 0, 0, 0,
481 // sh_addr
482 0, 0, 0, 0,
483 // sh_offset: after .strtab section. 290 == 0x122
484 0, 0, 0x1, 0x22,
485 // sh_size: all section names
486 0, 0, 0, 33,
487 // sh_link
488 0, 0, 0, 0,
489 // sh_info
490 0, 0, 0, 0,
491 // sh_addralign
492 0, 0, 0, 1,
493 // sh_entsize
494 0, 0, 0, 0,
495
496 // Offset 252
497 // Contents of .symtab section
498 // Symbol 0
499 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
500
501 // Offset 268
502 // Symbol 1
503 // st_name
504 0, 0, 0, 1,
505 // st_value
506 0, 0, 0, 0,
507 // st_size
508 0, 0, 0, 0,
509 // st_info: STT_NOTYPE, STB_GLOBAL
510 0x10,
511 // st_other
512 0,
513 // st_shndx: In .test
514 0, 1,
515
516 // Offset 284
517 // Contents of .strtab section
518 '\0',
519 't', 'e', 's', 't', '\0',
520
521 // Offset 290
522 // Contents of .shstrtab section
523 '\0',
524 '.', 't', 'e', 's', 't', '\0',
525 '.', 's', 'y', 'm', 't', 'a', 'b', '\0',
526 '.', 's', 't', 'r', 't', 'a', 'b', '\0',
527 '.', 's', 'h', 's', 't', 'r', 't', 'a', 'b', '\0'
528 };
529
530 const unsigned int test_file_1_size_32_big = sizeof test_file_1_32_big;
531
532 // 64-bit little-endian version of test_file_1_32_little.
533
534 const unsigned char test_file_1_64_little[] =
535 {
536 // Ehdr
537 // EI_MAG[0-3]
538 0x7f, 'E', 'L', 'F',
539 // EI_CLASS: 64 bit.
540 2,
541 // EI_DATA: little endian
542 1,
543 // EI_VERSION
544 1,
545 // EI_OSABI
546 0,
547 // EI_ABIVERSION
548 0,
549 // EI_PAD
550 0, 0, 0, 0, 0, 0, 0,
551 // e_type: ET_REL
552 1, 0,
553 // e_machine: a magic value used for testing.
554 0xff, 0xff,
555 // e_version
556 1, 0, 0, 0,
557 // e_entry
558 0, 0, 0, 0, 0, 0, 0, 0,
559 // e_phoff
560 0, 0, 0, 0, 0, 0, 0, 0,
561 // e_shoff: starts right after file header
562 64, 0, 0, 0, 0, 0, 0, 0,
563 // e_flags
564 0, 0, 0, 0,
565 // e_ehsize
566 64, 0,
567 // e_phentsize
568 56, 0,
569 // e_phnum
570 0, 0,
571 // e_shentsize
572 64, 0,
573 // e_shnum: dummy, .test, .symtab, .strtab, .shstrtab
574 5, 0,
575 // e_shstrndx
576 4, 0,
577
578 // Offset 64
579 // Shdr 0: dummy entry
580 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
581 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
582 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
583 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
584
585 // Offset 128
586 // Shdr 1: .test
587 // sh_name: after initial null
588 1, 0, 0, 0,
589 // sh_type: SHT_PROGBITS
590 1, 0, 0, 0,
591 // sh_flags: SHF_ALLOC
592 2, 0, 0, 0, 0, 0, 0, 0,
593 // sh_addr
594 0, 0, 0, 0, 0, 0, 0, 0,
595 // sh_offset: after file header + 5 section headers. 384 == 0x180.
596 0x80, 0x1, 0, 0, 0, 0, 0, 0,
597 // sh_size
598 0, 0, 0, 0, 0, 0, 0, 0,
599 // sh_link
600 0, 0, 0, 0,
601 // sh_info
602 0, 0, 0, 0,
603 // sh_addralign
604 1, 0, 0, 0, 0, 0, 0, 0,
605 // sh_entsize
606 0, 0, 0, 0, 0, 0, 0, 0,
607
608 // Offset 192
609 // Shdr 2: .symtab
610 // sh_name: 1 null byte + ".test\0"
611 7, 0, 0, 0,
612 // sh_type: SHT_SYMTAB
613 2, 0, 0, 0,
614 // sh_flags
615 0, 0, 0, 0, 0, 0, 0, 0,
616 // sh_addr
617 0, 0, 0, 0, 0, 0, 0, 0,
618 // sh_offset: after file header + 5 section headers + empty section
619 // 384 == 0x180.
620 0x80, 0x1, 0, 0, 0, 0, 0, 0,
621 // sh_size: two symbols: dummy symbol + test symbol
622 48, 0, 0, 0, 0, 0, 0, 0,
623 // sh_link: to .strtab
624 3, 0, 0, 0,
625 // sh_info: one local symbol, the dummy symbol
626 1, 0, 0, 0,
627 // sh_addralign
628 8, 0, 0, 0, 0, 0, 0, 0,
629 // sh_entsize: size of symbol
630 24, 0, 0, 0, 0, 0, 0, 0,
631
632 // Offset 256
633 // Shdr 3: .strtab
634 // sh_name: 1 null byte + ".test\0" + ".symtab\0"
635 15, 0, 0, 0,
636 // sh_type: SHT_STRTAB
637 3, 0, 0, 0,
638 // sh_flags
639 0, 0, 0, 0, 0, 0, 0, 0,
640 // sh_addr
641 0, 0, 0, 0, 0, 0, 0, 0,
642 // sh_offset: after .symtab section. 432 == 0x1b0
643 0xb0, 0x1, 0, 0, 0, 0, 0, 0,
644 // sh_size: 1 null byte + "test\0"
645 6, 0, 0, 0, 0, 0, 0, 0,
646 // sh_link
647 0, 0, 0, 0,
648 // sh_info
649 0, 0, 0, 0,
650 // sh_addralign
651 1, 0, 0, 0, 0, 0, 0, 0,
652 // sh_entsize
653 0, 0, 0, 0, 0, 0, 0, 0,
654
655 // Offset 320
656 // Shdr 4: .shstrtab
657 // sh_name: 1 null byte + ".test\0" + ".symtab\0" + ".strtab\0"
658 23, 0, 0, 0,
659 // sh_type: SHT_STRTAB
660 3, 0, 0, 0,
661 // sh_flags
662 0, 0, 0, 0, 0, 0, 0, 0,
663 // sh_addr
664 0, 0, 0, 0, 0, 0, 0, 0,
665 // sh_offset: after .strtab section. 438 == 0x1b6
666 0xb6, 0x1, 0, 0, 0, 0, 0, 0,
667 // sh_size: all section names
668 33, 0, 0, 0, 0, 0, 0, 0,
669 // sh_link
670 0, 0, 0, 0,
671 // sh_info
672 0, 0, 0, 0,
673 // sh_addralign
674 1, 0, 0, 0, 0, 0, 0, 0,
675 // sh_entsize
676 0, 0, 0, 0, 0, 0, 0, 0,
677
678 // Offset 384
679 // Contents of .symtab section
680 // Symbol 0
681 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
682 0, 0, 0, 0, 0, 0, 0, 0,
683
684 // Offset 408
685 // Symbol 1
686 // st_name
687 1, 0, 0, 0,
688 // st_info: STT_NOTYPE, STB_GLOBAL
689 0x10,
690 // st_other
691 0,
692 // st_shndx: In .test
693 1, 0,
694 // st_value
695 0, 0, 0, 0, 0, 0, 0, 0,
696 // st_size
697 0, 0, 0, 0, 0, 0, 0, 0,
698
699 // Offset 432
700 // Contents of .strtab section
701 '\0',
702 't', 'e', 's', 't', '\0',
703
704 // Offset 438
705 // Contents of .shstrtab section
706 '\0',
707 '.', 't', 'e', 's', 't', '\0',
708 '.', 's', 'y', 'm', 't', 'a', 'b', '\0',
709 '.', 's', 't', 'r', 't', 'a', 'b', '\0',
710 '.', 's', 'h', 's', 't', 'r', 't', 'a', 'b', '\0'
711 };
712
713 const unsigned int test_file_1_size_64_little = sizeof test_file_1_64_little;
714
715 // 64-bit big-endian version of test_file_1_32_little.
716
717 const unsigned char test_file_1_64_big[] =
718 {
719 // Ehdr
720 // EI_MAG[0-3]
721 0x7f, 'E', 'L', 'F',
722 // EI_CLASS: 64 bit.
723 2,
724 // EI_DATA: big endian
725 2,
726 // EI_VERSION
727 1,
728 // EI_OSABI
729 0,
730 // EI_ABIVERSION
731 0,
732 // EI_PAD
733 0, 0, 0, 0, 0, 0, 0,
734 // e_type: ET_REL
735 0, 1,
736 // e_machine: a magic value used for testing.
737 0xff, 0xff,
738 // e_version
739 0, 0, 0, 1,
740 // e_entry
741 0, 0, 0, 0, 0, 0, 0, 0,
742 // e_phoff
743 0, 0, 0, 0, 0, 0, 0, 0,
744 // e_shoff: starts right after file header
745 0, 0, 0, 0, 0, 0, 0, 64,
746 // e_flags
747 0, 0, 0, 0,
748 // e_ehsize
749 0, 64,
750 // e_phentsize
751 0, 56,
752 // e_phnum
753 0, 0,
754 // e_shentsize
755 0, 64,
756 // e_shnum: dummy, .test, .symtab, .strtab, .shstrtab
757 0, 5,
758 // e_shstrndx
759 0, 4,
760
761 // Offset 64
762 // Shdr 0: dummy entry
763 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
764 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
765 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
766 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
767
768 // Offset 128
769 // Shdr 1: .test
770 // sh_name: after initial null
771 0, 0, 0, 1,
772 // sh_type: SHT_PROGBITS
773 0, 0, 0, 1,
774 // sh_flags: SHF_ALLOC
775 0, 0, 0, 0, 0, 0, 0, 2,
776 // sh_addr
777 0, 0, 0, 0, 0, 0, 0, 0,
778 // sh_offset: after file header + 5 section headers. 384 == 0x180.
779 0, 0, 0, 0, 0, 0, 0x1, 0x80,
780 // sh_size
781 0, 0, 0, 0, 0, 0, 0, 0,
782 // sh_link
783 0, 0, 0, 0,
784 // sh_info
785 0, 0, 0, 0,
786 // sh_addralign
787 0, 0, 0, 0, 0, 0, 0, 1,
788 // sh_entsize
789 0, 0, 0, 0, 0, 0, 0, 0,
790
791 // Offset 192
792 // Shdr 2: .symtab
793 // sh_name: 1 null byte + ".test\0"
794 0, 0, 0, 7,
795 // sh_type: SHT_SYMTAB
796 0, 0, 0, 2,
797 // sh_flags
798 0, 0, 0, 0, 0, 0, 0, 0,
799 // sh_addr
800 0, 0, 0, 0, 0, 0, 0, 0,
801 // sh_offset: after file header + 5 section headers + empty section
802 // 384 == 0x180.
803 0, 0, 0, 0, 0, 0, 0x1, 0x80,
804 // sh_size: two symbols: dummy symbol + test symbol
805 0, 0, 0, 0, 0, 0, 0, 48,
806 // sh_link: to .strtab
807 0, 0, 0, 3,
808 // sh_info: one local symbol, the dummy symbol
809 0, 0, 0, 1,
810 // sh_addralign
811 0, 0, 0, 0, 0, 0, 0, 8,
812 // sh_entsize: size of symbol
813 0, 0, 0, 0, 0, 0, 0, 24,
814
815 // Offset 256
816 // Shdr 3: .strtab
817 // sh_name: 1 null byte + ".test\0" + ".symtab\0"
818 0, 0, 0, 15,
819 // sh_type: SHT_STRTAB
820 0, 0, 0, 3,
821 // sh_flags
822 0, 0, 0, 0, 0, 0, 0, 0,
823 // sh_addr
824 0, 0, 0, 0, 0, 0, 0, 0,
825 // sh_offset: after .symtab section. 432 == 0x1b0
826 0, 0, 0, 0, 0, 0, 0x1, 0xb0,
827 // sh_size: 1 null byte + "test\0"
828 0, 0, 0, 0, 0, 0, 0, 6,
829 // sh_link
830 0, 0, 0, 0,
831 // sh_info
832 0, 0, 0, 0,
833 // sh_addralign
834 0, 0, 0, 0, 0, 0, 0, 1,
835 // sh_entsize
836 0, 0, 0, 0, 0, 0, 0, 0,
837
838 // Offset 320
839 // Shdr 4: .shstrtab
840 // sh_name: 1 null byte + ".test\0" + ".symtab\0" + ".strtab\0"
841 0, 0, 0, 23,
842 // sh_type: SHT_STRTAB
843 0, 0, 0, 3,
844 // sh_flags
845 0, 0, 0, 0, 0, 0, 0, 0,
846 // sh_addr
847 0, 0, 0, 0, 0, 0, 0, 0,
848 // sh_offset: after .strtab section. 438 == 0x1b6
849 0, 0, 0, 0, 0, 0, 0x1, 0xb6,
850 // sh_size: all section names
851 0, 0, 0, 0, 0, 0, 0, 33,
852 // sh_link
853 0, 0, 0, 0,
854 // sh_info
855 0, 0, 0, 0,
856 // sh_addralign
857 0, 0, 0, 0, 0, 0, 0, 1,
858 // sh_entsize
859 0, 0, 0, 0, 0, 0, 0, 0,
860
861 // Offset 384
862 // Contents of .symtab section
863 // Symbol 0
864 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
865 0, 0, 0, 0, 0, 0, 0, 0,
866
867 // Offset 408
868 // Symbol 1
869 // st_name
870 0, 0, 0, 1,
871 // st_info: STT_NOTYPE, STB_GLOBAL
872 0x10,
873 // st_other
874 0,
875 // st_shndx: In .test
876 0, 1,
877 // st_value
878 0, 0, 0, 0, 0, 0, 0, 0,
879 // st_size
880 0, 0, 0, 0, 0, 0, 0, 0,
881
882 // Offset 432
883 // Contents of .strtab section
884 '\0',
885 't', 'e', 's', 't', '\0',
886
887 // Offset 438
888 // Contents of .shstrtab section
889 '\0',
890 '.', 't', 'e', 's', 't', '\0',
891 '.', 's', 'y', 'm', 't', 'a', 'b', '\0',
892 '.', 's', 't', 'r', 't', 'a', 'b', '\0',
893 '.', 's', 'h', 's', 't', 'r', 't', 'a', 'b', '\0'
894 };
895
896 const unsigned int test_file_1_size_64_big = sizeof test_file_1_64_big;
897
898 } // End namespace gold_testsuite.
This page took 0.050682 seconds and 5 git commands to generate.