diff options
author | Alan Modra <amodra@gmail.com> | 2005-03-16 02:41:28 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2005-03-16 02:41:28 +0000 |
commit | cb2d1ef2ae91983d0294ccdf71341f25badd168e (patch) | |
tree | e67bf565f343f3f3e458ad6e26baa8b0fba4c109 | |
parent | 4eb30afc4160a4cb51cf9d7501e96831b956cdc7 (diff) | |
download | gdb-cb2d1ef2ae91983d0294ccdf71341f25badd168e.zip gdb-cb2d1ef2ae91983d0294ccdf71341f25badd168e.tar.gz gdb-cb2d1ef2ae91983d0294ccdf71341f25badd168e.tar.bz2 |
bfd/
* elf32-ppc.c (ppc_elf_create_linker_section): Set SEC_LINKER_CREATED
on section. Correct comment, and add FIXME.
(ppc_elf_additional_program_headers): Don't bump header count for
interp. Test SEC_ALLOC, not SEC_LOAD, and don't test size.
(ppc_elf_size_dynamic_sections): Don't strip sdata and sdata2, but
do allocate memory if they need it.
ld/
* emulparams/elf32ppclinux.sh (OTHER_READWRITE_SECTION): Delete.
(OTHER_RELRO_SECTIONS): Set this instead.
ld/testsuite/
* ld-powerpc/tlsexe32.d: Update.
* ld-powerpc/tlsexe32.g: Update.
* ld-powerpc/tlsexe32.r: Update.
* ld-powerpc/tlsexe32.t: Update.
* ld-powerpc/tlsso32.d: Update.
* ld-powerpc/tlsso32.g: Update.
* ld-powerpc/tlsso32.r: Update.
* ld-powerpc/tlsso32.t: Update.
-rw-r--r-- | bfd/ChangeLog | 9 | ||||
-rw-r--r-- | bfd/elf32-ppc.c | 46 | ||||
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/emulparams/elf32ppclinux.sh | 2 | ||||
-rw-r--r-- | ld/testsuite/ChangeLog | 15 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsexe32.d | 66 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsexe32.g | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsexe32.r | 72 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsexe32.t | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsso32.d | 64 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsso32.g | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsso32.r | 123 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsso32.t | 4 |
13 files changed, 223 insertions, 199 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c69b076..51592c9 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,12 @@ +2005-03-16 Alan Modra <amodra@bigpond.net.au> + + * elf32-ppc.c (ppc_elf_create_linker_section): Set SEC_LINKER_CREATED + on section. Correct comment, and add FIXME. + (ppc_elf_additional_program_headers): Don't bump header count for + interp. Test SEC_ALLOC, not SEC_LOAD, and don't test size. + (ppc_elf_size_dynamic_sections): Don't strip sdata and sdata2, but + do allocate memory if they need it. + 2005-03-15 Mikkel Krautz <krautz@gmail.com> * config.bfd (x86_64-elf): Add target. diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index b38a48a..0866e46 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -2606,15 +2606,16 @@ ppc_elf_create_linker_section (bfd *abfd, const char *sym_name; bfd_vma sym_offset; - /* Both of these sections are (technically) created by the user - putting data in them, so they shouldn't be marked - SEC_LINKER_CREATED. - - The linker creates them so it has somewhere to attach their - respective symbols. In fact, if they were empty it would - be OK to leave the symbol set to 0 (or any random number), because - the appropriate register should never be used. */ - flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY; + /* The linker creates these sections so it has somewhere to attach + their respective symbols. Startup code (crt1.o) uses these symbols + to initialize a register pointing to the section. If the output + sections corresponding to these input sections were empty it would + be OK to set the symbol to 0 (or any random number), because the + associated register should never be used. + FIXME: Setting a symbol this way is silly. The symbols ought to + be set the same way other backends set gp. */ + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_LINKER_CREATED); sym_offset = 32768; switch (which) @@ -2711,27 +2712,21 @@ ppc_elf_create_linker_section (bfd *abfd, return lsect; } -/* If we have a non-zero sized .sbss2 or .PPC.EMB.sbss0 sections, we +/* If we have .sbss2 or .PPC.EMB.sbss0 output sections, we need to bump up the number of section headers. */ static int ppc_elf_additional_program_headers (bfd *abfd) { asection *s; - int ret; - - ret = 0; - - s = bfd_get_section_by_name (abfd, ".interp"); - if (s != NULL) - ++ret; + int ret = 0; s = bfd_get_section_by_name (abfd, ".sbss2"); - if (s != NULL && (s->flags & SEC_LOAD) != 0 && s->size > 0) + if (s != NULL && (s->flags & SEC_ALLOC) != 0) ++ret; s = bfd_get_section_by_name (abfd, ".PPC.EMB.sbss0"); - if (s != NULL && (s->flags & SEC_LOAD) != 0 && s->size > 0) + if (s != NULL && (s->flags & SEC_ALLOC) != 0) ++ret; return ret; @@ -3394,13 +3389,20 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, continue; if (s == htab->plt - || s == htab->got - || (htab->sdata != NULL && s == htab->sdata->section) - || (htab->sdata2 != NULL && s == htab->sdata2->section)) + || s == htab->got) { /* Strip this section if we don't need it; see the comment below. */ } + else if ((htab->sdata != NULL && s == htab->sdata->section) + || (htab->sdata2 != NULL && s == htab->sdata2->section)) + { + if (s->size == 0) + /* Don't strip these sections. We need them because they + define _SDA_BASE_ and _SDA2_BASE_. crt1.o makes a + reference to _SDA_BASE_ to set up r13. */ + continue; + } else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) { if (s->size == 0) diff --git a/ld/ChangeLog b/ld/ChangeLog index 37536b9..1ef1d76 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2005-03-16 Alan Modra <amodra@bigpond.net.au> + + * emulparams/elf32ppclinux.sh (OTHER_READWRITE_SECTION): Delete. + (OTHER_RELRO_SECTIONS): Set this instead. + 2005-03-15 Nick Clifton <nickc@redhat.com> * NEWS: Add cutoff for changes in 2.16 release. diff --git a/ld/emulparams/elf32ppclinux.sh b/ld/emulparams/elf32ppclinux.sh index 5ced00d..9642d4a 100644 --- a/ld/emulparams/elf32ppclinux.sh +++ b/ld/emulparams/elf32ppclinux.sh @@ -3,6 +3,6 @@ TEXT_START_ADDR=0x10000000 unset EXECUTABLE_SYMBOLS unset OTHER_BSS_END_SYMBOLS test -z "${RELOCATING}" || OTHER_SECTIONS="/DISCARD/ : { *(.fixup) }" -OTHER_READWRITE_SECTIONS=" +OTHER_RELRO_SECTIONS=" .got1 ${RELOCATING-0} : { *(.got1) } .got2 ${RELOCATING-0} : { *(.got2) }" diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index a089dd2..ca567cf 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2005-03-16 Alan Modra <amodra@bigpond.net.au> + + * ld-powerpc/tlsexe32.d: Update. + * ld-powerpc/tlsexe32.g: Update. + * ld-powerpc/tlsexe32.r: Update. + * ld-powerpc/tlsexe32.t: Update. + * ld-powerpc/tlsso32.d: Update. + * ld-powerpc/tlsso32.g: Update. + * ld-powerpc/tlsso32.r: Update. + * ld-powerpc/tlsso32.t: Update. + 2005-03-08 Hans-Peter Nilsson <hp@axis.com> Adjust testsuite for cris-axis-aout. @@ -63,7 +74,7 @@ * ld-d10v/default_layout.d: Adjust expected offsets to allow for section alignment. - + * ld-discard/extern.d: Adjust expected warning to take into account the fact that the linker's name might be included and that the reloc might have been adjusted to be against the section @@ -341,7 +352,7 @@ * ld-crx/reloc-abs32.d: Update reference file according to disassembler printing method. - * ld-crx/reloc-rel16.d: Likewise. + * ld-crx/reloc-rel16.d: Likewise. * ld-crx/reloc-rel24.d: Likewise. * ld-crx/reloc-rel32.d: Likewise. * ld-crx/reloc-rel4.d: Likewise. diff --git a/ld/testsuite/ld-powerpc/tlsexe32.d b/ld/testsuite/ld-powerpc/tlsexe32.d index b9e8b2e..0df39d5 100644 --- a/ld/testsuite/ld-powerpc/tlsexe32.d +++ b/ld/testsuite/ld-powerpc/tlsexe32.d @@ -8,39 +8,39 @@ Disassembly of section \.text: -01800264 <_start>: - 1800264: 80 7f 00 0c lwz r3,12\(r31\) - 1800268: 7c 63 12 14 add r3,r3,r2 - 180026c: 38 7f 00 10 addi r3,r31,16 - 1800270: 48 01 01 85 bl 18103f4 .* - 1800274: 3c 62 00 00 addis r3,r2,0 - 1800278: 38 63 90 1c addi r3,r3,-28644 - 180027c: 3c 62 00 00 addis r3,r2,0 - 1800280: 38 63 10 00 addi r3,r3,4096 - 1800284: 39 23 80 20 addi r9,r3,-32736 - 1800288: 3d 23 00 00 addis r9,r3,0 - 180028c: 81 49 80 24 lwz r10,-32732\(r9\) - 1800290: 3d 22 00 00 addis r9,r2,0 - 1800294: a1 49 90 2c lhz r10,-28628\(r9\) - 1800298: 89 42 90 30 lbz r10,-28624\(r2\) - 180029c: 3d 22 00 00 addis r9,r2,0 - 18002a0: 99 49 90 34 stb r10,-28620\(r9\) - 18002a4: 3c 62 00 00 addis r3,r2,0 - 18002a8: 38 63 90 00 addi r3,r3,-28672 - 18002ac: 3c 62 00 00 addis r3,r2,0 - 18002b0: 38 63 10 00 addi r3,r3,4096 - 18002b4: 91 43 80 04 stw r10,-32764\(r3\) - 18002b8: 3d 23 00 00 addis r9,r3,0 - 18002bc: 91 49 80 08 stw r10,-32760\(r9\) - 18002c0: 3d 22 00 00 addis r9,r2,0 - 18002c4: b1 49 90 2c sth r10,-28628\(r9\) - 18002c8: a1 42 90 14 lhz r10,-28652\(r2\) - 18002cc: 3d 22 00 00 addis r9,r2,0 - 18002d0: a9 49 90 18 lha r10,-28648\(r9\) +.* <_start>: +.*: 80 7f 00 0c lwz r3,12\(r31\) +.*: 7c 63 12 14 add r3,r3,r2 +.*: 38 7f 00 10 addi r3,r31,16 +.*: 48 01 01 85 bl .*<__tls_get_addr@plt> +.*: 3c 62 00 00 addis r3,r2,0 +.*: 38 63 90 1c addi r3,r3,-28644 +.*: 3c 62 00 00 addis r3,r2,0 +.*: 38 63 10 00 addi r3,r3,4096 +.*: 39 23 80 20 addi r9,r3,-32736 +.*: 3d 23 00 00 addis r9,r3,0 +.*: 81 49 80 24 lwz r10,-32732\(r9\) +.*: 3d 22 00 00 addis r9,r2,0 +.*: a1 49 90 2c lhz r10,-28628\(r9\) +.*: 89 42 90 30 lbz r10,-28624\(r2\) +.*: 3d 22 00 00 addis r9,r2,0 +.*: 99 49 90 34 stb r10,-28620\(r9\) +.*: 3c 62 00 00 addis r3,r2,0 +.*: 38 63 90 00 addi r3,r3,-28672 +.*: 3c 62 00 00 addis r3,r2,0 +.*: 38 63 10 00 addi r3,r3,4096 +.*: 91 43 80 04 stw r10,-32764\(r3\) +.*: 3d 23 00 00 addis r9,r3,0 +.*: 91 49 80 08 stw r10,-32760\(r9\) +.*: 3d 22 00 00 addis r9,r2,0 +.*: b1 49 90 2c sth r10,-28628\(r9\) +.*: a1 42 90 14 lhz r10,-28652\(r2\) +.*: 3d 22 00 00 addis r9,r2,0 +.*: a9 49 90 18 lha r10,-28648\(r9\) Disassembly of section \.got: -01810390 <_GLOBAL_OFFSET_TABLE_-0x4>: - 1810390: 4e 80 00 21 blrl -01810394 <_GLOBAL_OFFSET_TABLE_>: - 1810394: 01 81 02 f0 00 00 00 00 00 00 00 00 00 00 00 00 .* +.* <_GLOBAL_OFFSET_TABLE_-0x4>: +.*: 4e 80 00 21 blrl +.* <_GLOBAL_OFFSET_TABLE_>: +.*: 01 81 02 d0 00 00 00 00 00 00 00 00 00 00 00 00 .* \.\.\. diff --git a/ld/testsuite/ld-powerpc/tlsexe32.g b/ld/testsuite/ld-powerpc/tlsexe32.g index e30d60f..d68e601 100644 --- a/ld/testsuite/ld-powerpc/tlsexe32.g +++ b/ld/testsuite/ld-powerpc/tlsexe32.g @@ -7,5 +7,5 @@ .*: +file format elf32-powerpc Contents of section \.got: - 1810390 4e800021 018102f0 00000000 00000000 .* - 18103a0 00000000 00000000 00000000 .* +.* 4e800021 018102d0 00000000 00000000 .* +.* 00000000 00000000 00000000 .* diff --git a/ld/testsuite/ld-powerpc/tlsexe32.r b/ld/testsuite/ld-powerpc/tlsexe32.r index 1b8bf68..1ee352b 100644 --- a/ld/testsuite/ld-powerpc/tlsexe32.r +++ b/ld/testsuite/ld-powerpc/tlsexe32.r @@ -16,15 +16,15 @@ Section Headers: +\[ 4\] \.dynstr +.* +\[ 5\] \.rela\.dyn +.* +\[ 6\] \.rela\.plt +.* - +\[ 7\] \.text +PROGBITS +01800264 000264 000070 00 +AX +0 +0 +1 + +\[ 7\] \.text +PROGBITS +01800244 000244 000070 00 +AX +0 +0 +1 +\[ 8\] \.sdata2 +PROGBITS +.* - +\[ 9\] \.tdata +PROGBITS +018102d4 0002d4 00001c 00 WAT +0 +0 +4 - +\[10\] \.tbss +NOBITS +018102f0 0002f0 00001c 00 WAT +0 +0 +4 - +\[11\] \.dynamic +DYNAMIC +018102f0 0002f0 0000a0 08 +WA +4 +0 +4 - +\[12\] \.data +PROGBITS +01810390 000390 000000 00 +WA +0 +0 +1 - +\[13\] \.got +PROGBITS +01810390 000390 00001c 04 WAX +0 +0 +4 - +\[14\] \.sdata +PROGBITS +018103ac 0003ac 000000 00 +WA +0 +0 +4 - +\[15\] \.sbss +NOBITS +018103ac 0003ac 000000 00 +WA +0 +0 +1 + +\[ 9\] \.tdata +PROGBITS +018102b4 0002b4 00001c 00 WAT +0 +0 +4 + +\[10\] \.tbss +NOBITS +018102d0 0002d0 00001c 00 WAT +0 +0 +4 + +\[11\] \.dynamic +DYNAMIC +018102d0 0002d0 0000a0 08 +WA +4 +0 +4 + +\[12\] \.data +PROGBITS +01810370 000370 000000 00 +WA +0 +0 +1 + +\[13\] \.got +PROGBITS +01810370 000370 00001c 04 WAX +0 +0 +4 + +\[14\] \.sdata +PROGBITS +0181038c 00038c 000000 00 +WA +0 +0 +4 + +\[15\] \.sbss +NOBITS +0181038c 00038c 000000 00 +WA +0 +0 +1 +\[16\] \.plt +NOBITS +.* +\[17\] \.bss +NOBITS +.* +\[18\] \.shstrtab +STRTAB +.* @@ -33,18 +33,18 @@ Section Headers: #... Elf file type is EXEC \(Executable file\) -Entry point 0x1800264 +Entry point 0x1800244 There are 6 program headers, starting at offset 52 Program Headers: +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align - +PHDR +0x000034 0x01800034 0x01800034 0x000e0 0x000e0 R E 0x4 - +INTERP +0x000114 0x01800114 0x01800114 0x00011 0x00011 R +0x1 + +PHDR +0x000034 0x01800034 0x01800034 0x000c0 0x000c0 R E 0x4 + +INTERP +0x0000f4 0x018000f4 0x018000f4 0x00011 0x00011 R +0x1 +\[Requesting program interpreter: .*\] - +LOAD +0x000000 0x01800000 0x01800000 0x002d4 0x002d4 R E 0x10000 - +LOAD +0x0002d4 0x018102d4 0x018102d4 0x000d8 0x0012c RWE 0x10000 - +DYNAMIC +0x0002f0 0x018102f0 0x018102f0 0x000a0 0x000a0 RW +0x4 - +TLS +0x0002d4 0x018102d4 0x018102d4 0x0001c 0x00038 R +0x4 + +LOAD +0x000000 0x01800000 0x01800000 0x002b4 0x002b4 R E 0x10000 + +LOAD +0x0002b4 0x018102b4 0x018102b4 0x000d8 0x0012c RWE 0x10000 + +DYNAMIC +0x0002d0 0x018102d0 0x018102d0 0x000a0 0x000a0 RW +0x4 + +TLS +0x0002b4 0x018102b4 0x018102b4 0x0001c 0x00038 R +0x4 Section to Segment mapping: +Segment Sections\.\.\. @@ -55,26 +55,26 @@ Program Headers: +04 +\.dynamic +05 +\.tdata \.tbss -Relocation section '\.rela\.dyn' at offset 0x240 contains 2 entries: +Relocation section '\.rela\.dyn' at offset 0x220 contains 2 entries: Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend -018103a0 +00000249 R_PPC_TPREL32 +00000000 +gd \+ 0 -018103a4 +00000444 R_PPC_DTPMOD32 +00000000 +ld \+ 0 +01810380 +00000249 R_PPC_TPREL32 +00000000 +gd \+ 0 +01810384 +00000444 R_PPC_DTPMOD32 +00000000 +ld \+ 0 -Relocation section '\.rela\.plt' at offset 0x258 contains 1 entries: +Relocation section '\.rela\.plt' at offset 0x238 contains 1 entries: Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend -018103f4 +00000315 R_PPC_JMP_SLOT +018103f4 +__tls_get_addr \+ 0 +018103d4 +00000315 R_PPC_JMP_SLOT +018103d4 +__tls_get_addr \+ 0 Symbol table '\.dynsym' contains 9 entries: +Num: +Value +Size Type +Bind +Vis +Ndx Name +0: 00000000 +0 NOTYPE +LOCAL +DEFAULT +UND - +1: 018102f0 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC + +1: 018102d0 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC +2: 00000000 +0 TLS +GLOBAL DEFAULT +UND gd - +3: 018103f4 +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr + +3: 018103d4 +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr +4: 00000000 +0 TLS +GLOBAL DEFAULT +UND ld - +5: 01810400 +0 NOTYPE +GLOBAL DEFAULT +ABS __end - +6: 018103ac +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start - +7: 018103ac +0 NOTYPE +GLOBAL DEFAULT +ABS _edata - +8: 01810400 +0 NOTYPE +GLOBAL DEFAULT +ABS _end + +5: 018103e0 +0 NOTYPE +GLOBAL DEFAULT +ABS __end + +6: 0181038c +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start + +7: 0181038c +0 NOTYPE +GLOBAL DEFAULT +ABS _edata + +8: 018103e0 +0 NOTYPE +GLOBAL DEFAULT +ABS _end Symbol table '\.symtab' contains 47 entries: +Num: +Value +Size Type +Bind +Vis +Ndx Name @@ -85,15 +85,15 @@ Symbol table '\.symtab' contains 47 entries: +4: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +4 +5: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +5 +6: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +6 - +7: 01800264 +0 SECTION LOCAL +DEFAULT +7 + +7: 01800244 +0 SECTION LOCAL +DEFAULT +7 +8: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +8 - +9: 018102d4 +0 SECTION LOCAL +DEFAULT +9 - +10: 018102f0 +0 SECTION LOCAL +DEFAULT +10 - +11: 018102f0 +0 SECTION LOCAL +DEFAULT +11 - +12: 01810390 +0 SECTION LOCAL +DEFAULT +12 - +13: 01810390 +0 SECTION LOCAL +DEFAULT +13 - +14: 018103ac +0 SECTION LOCAL +DEFAULT +14 - +15: 018103ac +0 SECTION LOCAL +DEFAULT +15 + +9: 018102b4 +0 SECTION LOCAL +DEFAULT +9 + +10: 018102d0 +0 SECTION LOCAL +DEFAULT +10 + +11: 018102d0 +0 SECTION LOCAL +DEFAULT +11 + +12: 01810370 +0 SECTION LOCAL +DEFAULT +12 + +13: 01810370 +0 SECTION LOCAL +DEFAULT +13 + +14: 0181038c +0 SECTION LOCAL +DEFAULT +14 + +15: 0181038c +0 SECTION LOCAL +DEFAULT +15 +16: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +16 +17: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +17 +18: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +18 @@ -106,7 +106,7 @@ Symbol table '\.symtab' contains 47 entries: +25: 00000010 +0 TLS +LOCAL +DEFAULT +9 ie4 +26: 00000014 +0 TLS +LOCAL +DEFAULT +9 le4 +27: 00000018 +0 TLS +LOCAL +DEFAULT +9 le5 - +28: 018102f0 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC + +28: 018102d0 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC +29: 00000000 +0 TLS +GLOBAL DEFAULT +UND gd +30: 00000030 +0 TLS +GLOBAL DEFAULT +10 le0 +31: [0-9a-f]+ +0 FUNC +GLOBAL DEFAULT +UND __tls_get_addr @@ -120,7 +120,7 @@ Symbol table '\.symtab' contains 47 entries: +39: 00000024 +0 TLS +GLOBAL DEFAULT +10 ld1 +40: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start +41: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata - +42: 01810394 +0 OBJECT +GLOBAL +HIDDEN +13 _GLOBAL_OFFSET_TABLE_ + +42: 01810374 +0 OBJECT +GLOBAL +HIDDEN +13 _GLOBAL_OFFSET_TABLE_ +43: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end +44: 0000001c +0 TLS +GLOBAL DEFAULT +10 gd0 +45: 0000002c +0 TLS +GLOBAL DEFAULT +10 ie0 diff --git a/ld/testsuite/ld-powerpc/tlsexe32.t b/ld/testsuite/ld-powerpc/tlsexe32.t index 0e1d726..2312b33 100644 --- a/ld/testsuite/ld-powerpc/tlsexe32.t +++ b/ld/testsuite/ld-powerpc/tlsexe32.t @@ -7,5 +7,5 @@ .*: +file format elf32-powerpc Contents of section \.tdata: - 18102d4 12345678 23456789 3456789a 456789ab .* - 18102e4 56789abc 6789abcd 789abcde .* +.* 12345678 23456789 3456789a 456789ab .* +.* 56789abc 6789abcd 789abcde .* diff --git a/ld/testsuite/ld-powerpc/tlsso32.d b/ld/testsuite/ld-powerpc/tlsso32.d index 02e5d08..797ece9 100644 --- a/ld/testsuite/ld-powerpc/tlsso32.d +++ b/ld/testsuite/ld-powerpc/tlsso32.d @@ -8,38 +8,38 @@ Disassembly of section \.text: -0+46c <_start>: - 46c: 38 7f 00 1c addi r3,r31,28 - 470: 48 00 00 01 bl 470 .* - 474: 38 7f 00 0c addi r3,r31,12 - 478: 48 00 00 01 bl 478 .* - 47c: 38 7f 00 24 addi r3,r31,36 - 480: 48 01 01 95 bl 10614 .* - 484: 38 7f 00 0c addi r3,r31,12 - 488: 48 01 01 8d bl 10614 .* - 48c: 39 23 80 20 addi r9,r3,-32736 - 490: 3d 23 00 00 addis r9,r3,0 - 494: 81 49 80 24 lwz r10,-32732\(r9\) - 498: 81 3f 00 2c lwz r9,44\(r31\) - 49c: 7d 49 12 2e lhzx r10,r9,r2 - 4a0: 89 42 00 00 lbz r10,0\(r2\) - 4a4: 3d 22 00 00 addis r9,r2,0 - 4a8: 99 49 00 00 stb r10,0\(r9\) - 4ac: 38 7e 00 14 addi r3,r30,20 - 4b0: 48 00 00 01 bl 4b0 .* - 4b4: 38 7e 00 0c addi r3,r30,12 - 4b8: 48 00 00 01 bl 4b8 .* - 4bc: 91 43 80 04 stw r10,-32764\(r3\) - 4c0: 3d 23 00 00 addis r9,r3,0 - 4c4: 91 49 80 08 stw r10,-32760\(r9\) - 4c8: 81 3e 00 2c lwz r9,44\(r30\) - 4cc: 7d 49 13 2e sthx r10,r9,r2 - 4d0: a1 42 00 00 lhz r10,0\(r2\) - 4d4: 3d 22 00 00 addis r9,r2,0 - 4d8: a9 49 00 00 lha r10,0\(r9\) +.* <_start>: +.*: 38 7f 00 1c addi r3,r31,28 +.*: 48 00 00 01 bl .* +.*: 38 7f 00 0c addi r3,r31,12 +.*: 48 00 00 01 bl .* +.*: 38 7f 00 24 addi r3,r31,36 +.*: 48 01 01 95 bl .*<__tls_get_addr@plt> +.*: 38 7f 00 0c addi r3,r31,12 +.*: 48 01 01 8d bl .*<__tls_get_addr@plt> +.*: 39 23 80 20 addi r9,r3,-32736 +.*: 3d 23 00 00 addis r9,r3,0 +.*: 81 49 80 24 lwz r10,-32732\(r9\) +.*: 81 3f 00 2c lwz r9,44\(r31\) +.*: 7d 49 12 2e lhzx r10,r9,r2 +.*: 89 42 00 00 lbz r10,0\(r2\) +.*: 3d 22 00 00 addis r9,r2,0 +.*: 99 49 00 00 stb r10,0\(r9\) +.*: 38 7e 00 14 addi r3,r30,20 +.*: 48 00 00 01 bl .* +.*: 38 7e 00 0c addi r3,r30,12 +.*: 48 00 00 01 bl .* +.*: 91 43 80 04 stw r10,-32764\(r3\) +.*: 3d 23 00 00 addis r9,r3,0 +.*: 91 49 80 08 stw r10,-32760\(r9\) +.*: 81 3e 00 2c lwz r9,44\(r30\) +.*: 7d 49 13 2e sthx r10,r9,r2 +.*: a1 42 00 00 lhz r10,0\(r2\) +.*: 3d 22 00 00 addis r9,r2,0 +.*: a9 49 00 00 lha r10,0\(r9\) Disassembly of section \.got: -00010598 <\.got>: - 10598: 4e 80 00 21 blrl - 1059c: 00 01 04 f8 \.long 0x104f8 +.* <\.got>: +.*: 4e 80 00 21 blrl +.*: 00 01 04 e4 .* \.\.\. diff --git a/ld/testsuite/ld-powerpc/tlsso32.g b/ld/testsuite/ld-powerpc/tlsso32.g index 9639d4f..b20c76e 100644 --- a/ld/testsuite/ld-powerpc/tlsso32.g +++ b/ld/testsuite/ld-powerpc/tlsso32.g @@ -7,7 +7,7 @@ .*: +file format elf32-powerpc Contents of section \.got: - 10598 4e800021 000104f8 00000000 00000000 .* - 105a8 00000000 00000000 00000000 00000000 .* - 105b8 00000000 00000000 00000000 00000000 .* - 105c8 00000000 .* +.* 4e800021 000104e4 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 00000000 00000000 00000000 .* +.* 00000000 .* diff --git a/ld/testsuite/ld-powerpc/tlsso32.r b/ld/testsuite/ld-powerpc/tlsso32.r index e2b3543..eaa486c 100644 --- a/ld/testsuite/ld-powerpc/tlsso32.r +++ b/ld/testsuite/ld-powerpc/tlsso32.r @@ -4,7 +4,7 @@ #readelf: -WSsrl #target: powerpc*-*-* -There are 20 section headers.* +There are 19 section headers.* Section Headers: +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al @@ -14,20 +14,19 @@ Section Headers: +\[ 3\] \.dynstr +.* +\[ 4\] \.rela\.dyn +.* +\[ 5\] \.rela\.plt +.* - +\[ 6\] \.text +PROGBITS +0+46c 0+46c 0+70 0+ +AX +0 +0 +1 - +\[ 7\] \.tdata +PROGBITS +0+104dc 0+4dc 0+1c 0+ WAT +0 +0 +4 - +\[ 8\] \.tbss +NOBITS +0+104f8 0+4f8 0+1c 0+ WAT +0 +0 +4 - +\[ 9\] \.dynamic +DYNAMIC +0+104f8 0+4f8 0+a0 08 +WA +3 +0 +4 - +\[10\] \.data +PROGBITS +0+10598 0+598 0+ 0+ +WA +0 +0 +1 - +\[11\] \.got +PROGBITS +0+10598 0+598 0+34 04 WAX +0 +0 +4 - +\[12\] \.sdata2 +.* - +\[13\] \.sdata +.* - +\[14\] \.sbss +.* - +\[15\] \.plt +.* - +\[16\] \.bss +.* - +\[17\] \.shstrtab +.* - +\[18\] \.symtab +.* - +\[19\] \.strtab +.* + +\[ 6\] \.text +PROGBITS +0+458 0+458 0+70 0+ +AX +0 +0 +1 + +\[ 7\] \.tdata +PROGBITS +0+104c8 0+4c8 0+1c 0+ WAT +0 +0 +4 + +\[ 8\] \.tbss +NOBITS +0+104e4 0+4e4 0+1c 0+ WAT +0 +0 +4 + +\[ 9\] \.dynamic +DYNAMIC +0+104e4 0+4e4 0+a0 08 +WA +3 +0 +4 + +\[10\] \.data +PROGBITS +0+10584 0+584 0+ 0+ +WA +0 +0 +1 + +\[11\] \.got +PROGBITS +0+10584 0+584 0+34 04 WAX +0 +0 +4 + +\[12\] \.sdata +.* + +\[13\] \.sbss +.* + +\[14\] \.plt +.* + +\[15\] \.bss +.* + +\[16\] \.shstrtab +.* + +\[17\] \.symtab +.* + +\[18\] \.strtab +.* #... Elf file type is DYN \(Shared object file\) @@ -36,10 +35,10 @@ There are 4 program headers.* Program Headers: +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align - +LOAD +0x0+ 0x0+ 0x0+ 0x0+4dc 0x0+4dc R E 0x10000 - +LOAD +0x0+4dc 0x0+104dc 0x0+104dc 0x0+f0 0x0+144 RWE 0x10000 - +DYNAMIC +0x0+4f8 0x0+104f8 0x0+104f8 0x0+a0 0x0+a0 RW +0x4 - +TLS +0x0+4dc 0x0+104dc 0x0+104dc 0x0+1c 0x0+38 R +0x4 + +LOAD +0x0+ 0x0+ 0x0+ 0x0+4c8 0x0+4c8 R E 0x10000 + +LOAD +0x0+4c8 0x0+104c8 0x0+104c8 0x0+f0 0x0+144 RWE 0x10000 + +DYNAMIC +0x0+4e4 0x0+104e4 0x0+104e4 0x0+a0 0x0+a0 RW +0x4 + +TLS +0x0+4c8 0x0+104c8 0x0+104c8 0x0+1c 0x0+38 R +0x4 Section to Segment mapping: +Segment Sections\.\.\. @@ -50,41 +49,40 @@ Program Headers: Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 18 entries: Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend -0+470 +0+c0a R_PPC_REL24 +0+ +__tls_get_addr \+ 0 -0+478 +0+c0a R_PPC_REL24 +0+ +__tls_get_addr \+ 0 -0+4b0 +0+c0a R_PPC_REL24 +0+ +__tls_get_addr \+ 0 -0+4b8 +0+c0a R_PPC_REL24 +0+ +__tls_get_addr \+ 0 -0+4a2 +0+b45 R_PPC_TPREL16 +0+30 +le0 \+ 0 -0+4a6 +0+e48 R_PPC_TPREL16_HA +0+34 +le1 \+ 0 -0+4aa +0+e46 R_PPC_TPREL16_LO +0+34 +le1 \+ 0 -0+4d2 +0+245 R_PPC_TPREL16 +0+104dc +\.tdata \+ 104f0 -0+4d6 +0+248 R_PPC_TPREL16_HA +0+104dc +\.tdata \+ 104f4 -0+4da +0+246 R_PPC_TPREL16_LO +0+104dc +\.tdata \+ 104f4 -0+105a8 +0+44 R_PPC_DTPMOD32 +0+ -0+105b0 +0+44 R_PPC_DTPMOD32 +0+ -0+105b4 +0+4e R_PPC_DTPREL32 +0+ -0+105b8 +0+a44 R_PPC_DTPMOD32 +0+ +gd \+ 0 -0+105bc +0+a4e R_PPC_DTPREL32 +0+ +gd \+ 0 -0+105c0 +0+1844 R_PPC_DTPMOD32 +0+1c +gd0 \+ 0 -0+105c4 +0+184e R_PPC_DTPREL32 +0+1c +gd0 \+ 0 -0+105c8 +0+1949 R_PPC_TPREL32 +0+2c +ie0 \+ 0 +0+45c +0+b0a R_PPC_REL24 +0+ +__tls_get_addr \+ 0 +0+464 +0+b0a R_PPC_REL24 +0+ +__tls_get_addr \+ 0 +0+49c +0+b0a R_PPC_REL24 +0+ +__tls_get_addr \+ 0 +0+4a4 +0+b0a R_PPC_REL24 +0+ +__tls_get_addr \+ 0 +0+48e +0+a45 R_PPC_TPREL16 +0+30 +le0 \+ 0 +0+492 +0+d48 R_PPC_TPREL16_HA +0+34 +le1 \+ 0 +0+496 +0+d46 R_PPC_TPREL16_LO +0+34 +le1 \+ 0 +0+4be +0+245 R_PPC_TPREL16 +0+104c8 +\.tdata \+ 104dc +0+4c2 +0+248 R_PPC_TPREL16_HA +0+104c8 +\.tdata \+ 104e0 +0+4c6 +0+246 R_PPC_TPREL16_LO +0+104c8 +\.tdata \+ 104e0 +0+10594 +0+44 R_PPC_DTPMOD32 +0+ +0+1059c +0+44 R_PPC_DTPMOD32 +0+ +0+105a0 +0+4e R_PPC_DTPREL32 +0+ +0+105a4 +0+944 R_PPC_DTPMOD32 +0+ +gd \+ 0 +0+105a8 +0+94e R_PPC_DTPREL32 +0+ +gd \+ 0 +0+105ac +0+1744 R_PPC_DTPMOD32 +0+1c +gd0 \+ 0 +0+105b0 +0+174e R_PPC_DTPREL32 +0+1c +gd0 \+ 0 +0+105b4 +0+1849 R_PPC_TPREL32 +0+2c +ie0 \+ 0 Relocation section '\.rela\.plt' at offset 0x[0-9a-f]+ contains 1 entries: Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend -0+10614 +0+c15 R_PPC_JMP_SLOT +0+ +__tls_get_addr \+ 0 +0+10600 +0+b15 R_PPC_JMP_SLOT +0+ +__tls_get_addr \+ 0 -Symbol table '\.dynsym' contains 27 entries: +Symbol table '\.dynsym' contains 26 entries: +Num: +Value +Size Type +Bind +Vis +Ndx Name +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND - +[0-9]+: 0+46c +0 SECTION LOCAL +DEFAULT +6 - +[0-9]+: 0+104dc +0 SECTION LOCAL +DEFAULT +7 - +[0-9]+: 0+104f8 +0 SECTION LOCAL +DEFAULT +8 - +[0-9]+: 0+10598 +0 SECTION LOCAL +DEFAULT +10 - +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +12 - +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +13 - +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +14 - +[0-9]+: 0+10620 +0 SECTION LOCAL +DEFAULT +16 - +[0-9]+: 0+104f8 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC + +[0-9]+: 0+458 +0 SECTION LOCAL +DEFAULT +6 + +[0-9]+: 0+104c8 +0 SECTION LOCAL +DEFAULT +7 + +[0-9]+: 0+104e4 +0 SECTION LOCAL +DEFAULT +8 + +[0-9]+: 0+10584 +0 SECTION LOCAL +DEFAULT +10 + +[0-9]+: 0+105b8 +0 SECTION LOCAL +DEFAULT +12 + +[0-9]+: 0+105b8 +0 SECTION LOCAL +DEFAULT +13 + +[0-9]+: 0+1060c +0 SECTION LOCAL +DEFAULT +15 + +[0-9]+: 0+104e4 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND gd +[0-9]+: 0+30 +0 TLS +GLOBAL DEFAULT +8 le0 +[0-9]+: 0+ +0 NOTYPE +GLOBAL DEFAULT +UND __tls_get_addr @@ -93,7 +91,7 @@ Symbol table '\.dynsym' contains 27 entries: +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND ld +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +6 _start +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __end - +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +13 _SDA_BASE_ + +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +12 _SDA_BASE_ +[0-9]+: 0+28 +0 TLS +GLOBAL DEFAULT +8 ld2 +[0-9]+: 0+24 +0 TLS +GLOBAL DEFAULT +8 ld1 +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start @@ -103,7 +101,7 @@ Symbol table '\.dynsym' contains 27 entries: +[0-9]+: 0+2c +0 TLS +GLOBAL DEFAULT +8 ie0 +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +12 _SDA2_BASE_ -Symbol table '\.symtab' contains 46 entries: +Symbol table '\.symtab' contains 45 entries: +Num: +Value +Size Type +Bind +Vis +Ndx Name +[0-9]+: 0+ +0 NOTYPE +LOCAL +DEFAULT +UND +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +1 @@ -111,20 +109,19 @@ Symbol table '\.symtab' contains 46 entries: +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +3 +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +4 +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +5 - +[0-9]+: 0+46c +0 SECTION LOCAL +DEFAULT +6 - +[0-9]+: 0+104dc +0 SECTION LOCAL +DEFAULT +7 - +[0-9]+: 0+104f8 +0 SECTION LOCAL +DEFAULT +8 + +[0-9]+: 0+458 +0 SECTION LOCAL +DEFAULT +6 + +[0-9]+: 0+104c8 +0 SECTION LOCAL +DEFAULT +7 + +[0-9]+: 0+104e4 +0 SECTION LOCAL +DEFAULT +8 +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +9 - +[0-9]+: 0+10598 +0 SECTION LOCAL +DEFAULT +10 + +[0-9]+: 0+10584 +0 SECTION LOCAL +DEFAULT +10 +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +11 - +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +12 - +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +13 - +[0-9]+: 0+105cc +0 SECTION LOCAL +DEFAULT +14 - +[0-9]+: [0-9a-f]+ +0 SECTION LOCAL +DEFAULT +15 - +[0-9]+: 0+10620 +0 SECTION LOCAL +DEFAULT +16 + +[0-9]+: 0+105b8 +0 SECTION LOCAL +DEFAULT +12 + +[0-9]+: 0+105b8 +0 SECTION LOCAL +DEFAULT +13 + +[0-9]+: 0+105b8 +0 SECTION LOCAL +DEFAULT +14 + +[0-9]+: 0+1060c +0 SECTION LOCAL +DEFAULT +15 + +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +16 +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +17 +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +18 - +[0-9]+: 0+ +0 SECTION LOCAL +DEFAULT +19 +[0-9]+: 0+ +0 TLS +LOCAL +DEFAULT +7 gd4 +[0-9]+: 0+4 +0 TLS +LOCAL +DEFAULT +7 ld4 +[0-9]+: 0+8 +0 TLS +LOCAL +DEFAULT +7 ld5 @@ -132,8 +129,8 @@ Symbol table '\.symtab' contains 46 entries: +[0-9]+: 0+10 +0 TLS +LOCAL +DEFAULT +7 ie4 +[0-9]+: 0+14 +0 TLS +LOCAL +DEFAULT +7 le4 +[0-9]+: 0+18 +0 TLS +LOCAL +DEFAULT +7 le5 - +[0-9]+: 0+1059c +0 OBJECT +LOCAL +HIDDEN +ABS _GLOBAL_OFFSET_TABLE_ - +[0-9]+: 0+104f8 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC + +[0-9]+: 0+10588 +0 OBJECT +LOCAL +HIDDEN +ABS _GLOBAL_OFFSET_TABLE_ + +[0-9]+: 0+104e4 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND gd +[0-9]+: 0+30 +0 TLS +GLOBAL DEFAULT +8 le0 +[0-9]+: 0+ +0 NOTYPE +GLOBAL DEFAULT +UND __tls_get_addr @@ -142,7 +139,7 @@ Symbol table '\.symtab' contains 46 entries: +[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND ld +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +6 _start +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __end - +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +13 _SDA_BASE_ + +[0-9]+: [0-9a-f]+ +0 OBJECT +GLOBAL DEFAULT +12 _SDA_BASE_ +[0-9]+: 0+28 +0 TLS +GLOBAL DEFAULT +8 ld2 +[0-9]+: 0+24 +0 TLS +GLOBAL DEFAULT +8 ld1 +[0-9]+: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start diff --git a/ld/testsuite/ld-powerpc/tlsso32.t b/ld/testsuite/ld-powerpc/tlsso32.t index 66a38d5..4190a9a 100644 --- a/ld/testsuite/ld-powerpc/tlsso32.t +++ b/ld/testsuite/ld-powerpc/tlsso32.t @@ -7,5 +7,5 @@ .*: +file format elf32-powerpc Contents of section \.tdata: - 104dc 12345678 23456789 3456789a 456789ab .* - 104ec 56789abc 6789abcd 789abcde .* +.* 12345678 23456789 3456789a 456789ab .* +.* 56789abc 6789abcd 789abcde .* |