From f40da81ba51cd6e300f929ef29f14865a3e7bfcd Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 2 Jul 2013 00:25:08 +0000 Subject: [PATCH] bfd/ * elf64-ppc.c (ppc64_elf_relocate_section): Set "relocation" for .TOC. after relocatable check. gas/ * config/tc-ppc.c (ppc_elf_adjust_symtab): Don't make .TOC. weak. --- bfd/ChangeLog | 5 +++++ bfd/elf64-ppc.c | 15 ++++++++------- gas/ChangeLog | 4 ++++ gas/config/tc-ppc.c | 2 -- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1bbbb87a2d5..b55f3adc2c0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2013-07-02 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Set "relocation" for + .TOC. after relocatable check. + 2013-07-01 Alan Modra * elf64-ppc.h (ppc64_elf_toc): Delete. diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index fb808d649fa..7829520a7f2 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -12467,13 +12467,6 @@ ppc64_elf_relocate_section (bfd *output_bfd, } } } - if (h_elf == htab->elf.hgot) - { - relocation = (TOCstart - + htab->stub_group[input_section->id].toc_off); - sec = bfd_abs_section_ptr; - unresolved_reloc = FALSE; - } } h = (struct ppc_link_hash_entry *) h_elf; @@ -12486,6 +12479,14 @@ ppc64_elf_relocate_section (bfd *output_bfd, if (info->relocatable) continue; + if (h != NULL && &h->elf == htab->elf.hgot) + { + relocation = (TOCstart + + htab->stub_group[input_section->id].toc_off); + sec = bfd_abs_section_ptr; + unresolved_reloc = FALSE; + } + /* TLS optimizations. Replace instruction sequences and relocs based on information we collected in tls_optimize. We edit RELOCS so that --emit-relocs will output something sensible diff --git a/gas/ChangeLog b/gas/ChangeLog index 5e7a4933042..7f7d0e879b0 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2013-07-02 Alan Modra + + * config/tc-ppc.c (ppc_elf_adjust_symtab): Don't make .TOC. weak. + 2013-06-26 Maciej W. Rozycki * doc/as.texinfo (Overview): Remove @samp from MIPS ISA names. diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index d4f6b71681a..7aebda8e583 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -2318,8 +2318,6 @@ ppc_elf_adjust_symtab (void) asymbol *bsym = symbol_get_bfdsym (symp); if ((bsym->flags & BSF_KEEP) == 0) symbol_remove (symp, &symbol_rootP, &symbol_lastP); - else - S_SET_WEAK (symp); } } } -- 2.30.2