From: Alan Modra Date: Thu, 17 May 2012 02:43:36 +0000 (+0000) Subject: bfd/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ab6dce23364e9c7a29d06da1bb26a5923fdb84f9;p=binutils-gdb.git bfd/ * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make _DYNAMIC, _GLOBAL_OFFSET_TABLE_ or _PROCEDURE_LINKAGE_TABLE_ absolute. * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Don't make _DYNAMIC absolute. ld/testsuite/ * ld-powerpc/tlsso.r: Update for dynamic sym changes. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 62f5c1e5f8f..f9262d2339c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2012-05-17 Alan Modra + + * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make _DYNAMIC, + _GLOBAL_OFFSET_TABLE_ or _PROCEDURE_LINKAGE_TABLE_ absolute. + * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Don't make _DYNAMIC + absolute. + 2012-05-17 Alan Modra * elf32-ppc.c (has_tls_reloc, has_tls_get_addr_call, has_vle_insns, diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 0835a91f7c6..63d77d26a5f 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -9139,14 +9139,6 @@ ppc_elf_finish_dynamic_symbol (bfd *output_bfd, fprintf (stderr, "\n"); #endif - /* Mark some specially defined symbols as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0 - || (!htab->is_vxworks - && (h == htab->elf.hgot - || strcmp (h->root.root.string, - "_PROCEDURE_LINKAGE_TABLE_") == 0))) - sym->st_shndx = SHN_ABS; - return TRUE; } diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index f1f0f8f7b05..482cf4d0fb3 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -13869,7 +13869,7 @@ static bfd_boolean ppc64_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, struct elf_link_hash_entry *h, - Elf_Internal_Sym *sym) + Elf_Internal_Sym *sym ATTRIBUTE_UNUSED) { struct ppc_link_hash_table *htab; struct plt_entry *ent; @@ -13938,10 +13938,6 @@ ppc64_elf_finish_dynamic_symbol (bfd *output_bfd, bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); } - /* Mark some specially defined symbols as absolute. */ - if (strcmp (h->root.root.string, "_DYNAMIC") == 0) - sym->st_shndx = SHN_ABS; - return TRUE; } diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index f33d90d2b4b..0ca1cb2539b 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2012-05-17 Alan Modra + + * ld-powerpc/tlsso.r: Update for dynamic sym changes. + * ld-powerpc/tlsso32.d: Likewise. + * ld-powerpc/tlsso32.r: Likewise. + * ld-powerpc/tlstocso.r: Likewise. + 2012-05-16 Meador Inge * ld-arm/gc-hidden-1.d: Fix disassembly pattern. diff --git a/ld/testsuite/ld-powerpc/tlsso.r b/ld/testsuite/ld-powerpc/tlsso.r index 9171449f241..c417dbb89b9 100644 --- a/ld/testsuite/ld-powerpc/tlsso.r +++ b/ld/testsuite/ld-powerpc/tlsso.r @@ -107,7 +107,7 @@ Symbol table '\.symtab' contains [0-9]+ entries: .* TLS +LOCAL +DEFAULT +7 ie4 .* TLS +LOCAL +DEFAULT +7 le4 .* TLS +LOCAL +DEFAULT +7 le5 -.* OBJECT +LOCAL +DEFAULT +ABS _DYNAMIC +.* OBJECT +LOCAL +DEFAULT +9 _DYNAMIC .* NOTYPE +LOCAL +DEFAULT +6 00000010\.plt_call\.__tls_get_addr\+0 .* NOTYPE +LOCAL +DEFAULT +6 __glink_PLTresolve .* NOTYPE +LOCAL +DEFAULT +UND \.__tls_get_addr diff --git a/ld/testsuite/ld-powerpc/tlsso32.d b/ld/testsuite/ld-powerpc/tlsso32.d index b4e45d8745d..8d4ac4ef700 100644 --- a/ld/testsuite/ld-powerpc/tlsso32.d +++ b/ld/testsuite/ld-powerpc/tlsso32.d @@ -39,8 +39,9 @@ Disassembly of section \.text: .*: a9 49 00 00 lha r10,0\(r9\) Disassembly of section \.got: -.* <\.got>: - \.\.\. +.* <_GLOBAL_OFFSET_TABLE_-0x28>: +#... .*: 4e 80 00 21 blrl -.*: 00 01 03 ec .* - \.\.\. +.* <_GLOBAL_OFFSET_TABLE_>: +.*: 00 01 03 ec .* +#pass diff --git a/ld/testsuite/ld-powerpc/tlsso32.r b/ld/testsuite/ld-powerpc/tlsso32.r index 1217d68412e..0eb4a3c3d31 100644 --- a/ld/testsuite/ld-powerpc/tlsso32.r +++ b/ld/testsuite/ld-powerpc/tlsso32.r @@ -110,8 +110,8 @@ Symbol table '\.symtab' contains [0-9]+ entries: .* TLS +LOCAL +DEFAULT +7 ie4 .* TLS +LOCAL +DEFAULT +7 le4 .* TLS +LOCAL +DEFAULT +7 le5 -.* OBJECT +LOCAL +DEFAULT +ABS _DYNAMIC -.* OBJECT +LOCAL +DEFAULT +ABS _GLOBAL_OFFSET_TABLE_ +.* OBJECT +LOCAL +DEFAULT +9 _DYNAMIC +.* OBJECT +LOCAL +DEFAULT +10 _GLOBAL_OFFSET_TABLE_ .* TLS +GLOBAL +DEFAULT +UND gd .* TLS +GLOBAL +DEFAULT +8 le0 .* NOTYPE +GLOBAL +DEFAULT +UND __tls_get_addr diff --git a/ld/testsuite/ld-powerpc/tlstocso.r b/ld/testsuite/ld-powerpc/tlstocso.r index 040d69fa48a..211a2605464 100644 --- a/ld/testsuite/ld-powerpc/tlstocso.r +++ b/ld/testsuite/ld-powerpc/tlstocso.r @@ -103,7 +103,7 @@ Symbol table '\.symtab' contains [0-9]+ entries: .* TLS +LOCAL +DEFAULT +7 le4 .* TLS +LOCAL +DEFAULT +7 le5 .* NOTYPE +LOCAL +DEFAULT +10 \.Lie0 -.* OBJECT +LOCAL +DEFAULT +ABS _DYNAMIC +.* OBJECT +LOCAL +DEFAULT +9 _DYNAMIC .* NOTYPE +LOCAL +DEFAULT +6 00000010\.plt_call\.__tls_get_addr\+0 .* NOTYPE +LOCAL +DEFAULT +6 __glink_PLTresolve .* NOTYPE +LOCAL +DEFAULT +UND \.__tls_get_addr