diff options
author | Alan Modra <amodra@gmail.com> | 2004-08-17 01:25:21 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2004-08-17 01:25:21 +0000 |
commit | 816881401eed1e79939dbbbd16ad5ffb5f6332e7 (patch) | |
tree | a7a69681b009a2f96dc9f4fd19494bb6d40f6031 /bfd/elf64-ppc.c | |
parent | 2f4a83ee593c83ec1205f2e9643aca1e4d976c0b (diff) | |
download | gdb-816881401eed1e79939dbbbd16ad5ffb5f6332e7.zip gdb-816881401eed1e79939dbbbd16ad5ffb5f6332e7.tar.gz gdb-816881401eed1e79939dbbbd16ad5ffb5f6332e7.tar.bz2 |
* elf64-ppc.c (struct ppc64_elf_obj_tdata): Add "deleted_section".
(adjust_opd_syms): Attach opd syms for deleted entries to one of
the sections that will be discarded.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r-- | bfd/elf64-ppc.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index fca84ac..ccb8089 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -2333,6 +2333,10 @@ struct ppc64_elf_obj_tdata asection *got; asection *relgot; + /* Used during garbage collection. We attach global symbols defined + on removed .opd entries to this section so that the sym is removed. */ + asection *deleted_section; + /* TLS local dynamic got entry handling. Suppose for multiple GOT sections means we potentially need one of these for each input bfd. */ union { @@ -5227,8 +5231,18 @@ adjust_opd_syms (struct elf_link_hash_entry *h, void *inf ATTRIBUTE_UNUSED) if (adjust == -1) { /* This entry has been deleted. */ + asection *dsec = ppc64_elf_tdata (sym_sec->owner)->deleted_section; + if (dsec == NULL) + { + for (dsec = sym_sec->owner->sections; dsec; dsec = dsec->next) + if (elf_discarded_section (dsec)) + { + ppc64_elf_tdata (sym_sec->owner)->deleted_section = dsec; + break; + } + } eh->elf.root.u.def.value = 0; - eh->elf.root.u.def.section = &bfd_abs_section; + eh->elf.root.u.def.section = dsec; } else eh->elf.root.u.def.value += adjust; |