diff options
author | Alan Modra <amodra@gmail.com> | 2005-05-14 05:07:20 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2005-05-14 05:07:20 +0000 |
commit | 1fe44d798603c762f0c3570717a7741d82d9de9b (patch) | |
tree | f77373c53b61fa3c44161df2424073433956dd7e /bfd/elf32-ppc.c | |
parent | f59f7c79edab80fcebf332a0b7f7c421dadeb81b (diff) | |
download | gdb-1fe44d798603c762f0c3570717a7741d82d9de9b.zip gdb-1fe44d798603c762f0c3570717a7741d82d9de9b.tar.gz gdb-1fe44d798603c762f0c3570717a7741d82d9de9b.tar.bz2 |
include/elf/
* ppc.h (DT_PPC_GOT): Rename from DT_PPC_GLINK.
bfd/
* elf32-ppc.c (ppc_elf_size_dynamic_sections): Set DT_PPC_GOT,
not DT_PPC_GLINK.
(ppc_elf_finish_dynamic_sections): Likewise.
binutils/
* readelf.c (get_ppc_dynamic_type): Display DT_PPC_GOT, not
DT_PPC_GLINK.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r-- | bfd/elf32-ppc.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index bc19406..67e7677 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -4406,7 +4406,7 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, if (htab->glink != NULL && htab->glink->size != 0) { - if (!add_dynamic_entry (DT_PPC_GLINK, 0)) + if (!add_dynamic_entry (DT_PPC_GOT, 0)) return FALSE; } @@ -6313,6 +6313,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, { asection *sdyn; struct ppc_elf_link_hash_table *htab; + bfd_vma got; #ifdef DEBUG fprintf (stderr, "ppc_elf_finish_dynamic_sections called\n"); @@ -6321,6 +6322,12 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, htab = ppc_elf_hash_table (info); sdyn = bfd_get_section_by_name (htab->elf.dynobj, ".dynamic"); + got = 0; + if (htab->elf.hgot != NULL) + got = (htab->elf.hgot->root.u.def.value + + htab->elf.hgot->root.u.def.section->output_section->vma + + htab->elf.hgot->root.u.def.section->output_offset); + if (htab->elf.dynamic_sections_created) { Elf32_External_Dyn *dyncon, *dynconend; @@ -6352,10 +6359,8 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; break; - case DT_PPC_GLINK: - s = htab->glink; - dyn.d_un.d_ptr = (s->size - GLINK_PLTRESOLVE - + s->output_section->vma + s->output_offset); + case DT_PPC_GOT: + dyn.d_un.d_ptr = got; break; default: @@ -6389,7 +6394,7 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, { unsigned char *p; unsigned char *endp; - bfd_vma got, pltgot; + bfd_vma pltgot; unsigned int i; static const unsigned int plt_resolve[] = { @@ -6409,10 +6414,6 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, #define PPC_HI(v) (((v) >> 16) & 0xffff) #define PPC_HA(v) PPC_HI ((v) + 0x8000) - got = (htab->elf.hgot->root.u.def.value - + htab->elf.hgot->root.u.def.section->output_section->vma - + htab->elf.hgot->root.u.def.section->output_offset); - pltgot = (htab->plt->output_section->vma + htab->plt->output_offset - got); |