summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2004-01-13 00:31:07 +0000
committerAlan Modra <amodra@bigpond.net.au>2004-01-13 00:31:07 +0000
commit44bd8899b71a6ebe81af9cb22fffcfa7113b72e9 (patch)
tree2eec8319ab0fcf9938afc17f292df9561a013a28
parent1fc7d757ac890c9666b9e31167968caa15e98f65 (diff)
downloadbinutils-redhat-44bd8899b71a6ebe81af9cb22fffcfa7113b72e9.tar.gz
* elf64-ppc.c (ppc64_elf_check_relocs): Ignore !SEC_ALLOC relocs.
(ppc64_elf_gc_sweep_hook): Likewise. (ppc64_elf_size_dynamic_sections): Test for .plt directly.
-rw-r--r--bfd/ChangeLog12
-rw-r--r--bfd/elf64-ppc.c18
2 files changed, 22 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 811fb8f365..2bc8d448b1 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,11 +1,17 @@
+2004-01-13 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_check_relocs): Ignore !SEC_ALLOC relocs.
+ (ppc64_elf_gc_sweep_hook): Likewise.
+ (ppc64_elf_size_dynamic_sections): Test for .plt directly.
+
2004-01-12 Anil Paranjpe <anilp1@KPITCummins.com>
Adds linker relaxation support for bit manipulation insns like
- band, bclr, biand, bild, bior, bist, bixor, bld, bnot, bor, bset,
+ band, bclr, biand, bild, bior, bist, bixor, bld, bnot, bor, bset,
bst, btst, bxor.
- * elf32-h8300.c : Opcode for bit manipulation insn is checked in
+ * elf32-h8300.c: Opcode for bit manipulation insn is checked in
elf32_h8_relax_section function while relxation for aa:16 and aa:32.
- * coff-h8300.c : Opcode for bit manipulation insn is checked in
+ * coff-h8300.c: Opcode for bit manipulation insn is checked in
h8300_reloc16_extra_cases function while relxation for aa:16 and aa:32.
2004-01-12 Alan Modra <amodra@bigpond.net.au>
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 3ed9042e6f..304a635856 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -3590,6 +3590,15 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (info->relocatable)
return TRUE;
+ /* Don't do anything special with non-loaded, non-alloced sections.
+ In particular, any relocs in such sections should not affect GOT
+ and PLT reference counting (ie. we don't allow them to create GOT
+ or PLT entries), there's no possibility or desire to optimize TLS
+ relocs, and there's not much point in propagating relocs to shared
+ libs that the dynamic linker won't relocate. */
+ if ((sec->flags & SEC_ALLOC) == 0)
+ return TRUE;
+
htab = ppc_hash_table (info);
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -3947,10 +3956,6 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (NO_OPD_RELOCS && opd_sym_map != NULL)
break;
- /* Don't propagate relocs that the dynamic linker won't relocate. */
- if ((sec->flags & SEC_ALLOC) == 0)
- break;
-
/* If we are creating a shared library, and this is a reloc
against a global symbol, or a non PC relative reloc
against a local symbol, then we need to copy the reloc
@@ -4166,6 +4171,9 @@ ppc64_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
struct got_entry **local_got_ents;
const Elf_Internal_Rela *rel, *relend;
+ if ((sec->flags & SEC_ALLOC) == 0)
+ return TRUE;
+
elf_section_data (sec)->local_dynrel = NULL;
htab = ppc_hash_table (info);
@@ -6001,7 +6009,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
}
/* .plt is in the bss section. We don't initialise it. */
- if ((s->flags & SEC_LOAD) == 0)
+ if (s == htab->plt)
continue;
/* Allocate memory for the section contents. We use bfd_zalloc