aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-hppa.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-03-07 06:01:17 +0000
committerAlan Modra <amodra@gmail.com>2005-03-07 06:01:17 +0000
commitb18e2ae59e62bbe2f1f06dbb772dfc525e519a6d (patch)
tree39a53653f6d7b2c0891e540df22bc28d10a3ad97 /bfd/elf32-hppa.c
parentbf48a57f778e5c744b3bedc8bfb0ca4f8dab97a1 (diff)
downloadgdb-b18e2ae59e62bbe2f1f06dbb772dfc525e519a6d.zip
gdb-b18e2ae59e62bbe2f1f06dbb772dfc525e519a6d.tar.gz
gdb-b18e2ae59e62bbe2f1f06dbb772dfc525e519a6d.tar.bz2
PR ld/778
* elf32-hppa.c (elf32_hppa_create_dynamic_sections): Reinstate _GLOBAL_OFFSET_TABLE_ as a normal dynamic symbol.
Diffstat (limited to 'bfd/elf32-hppa.c')
-rw-r--r--bfd/elf32-hppa.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index d861847..5925011 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -937,6 +937,7 @@ static bfd_boolean
elf32_hppa_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
{
struct elf32_hppa_link_hash_table *htab;
+ struct elf_link_hash_entry *h;
/* Don't try to create the .plt and .got twice. */
htab = hppa_link_hash_table (info);
@@ -966,7 +967,12 @@ elf32_hppa_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
htab->sdynbss = bfd_get_section_by_name (abfd, ".dynbss");
htab->srelbss = bfd_get_section_by_name (abfd, ".rela.bss");
- return TRUE;
+ /* hppa-linux needs _GLOBAL_OFFSET_TABLE_ to be visible from the main
+ application, because __canonicalize_funcptr_for_compare needs it. */
+ h = elf_hash_table (info)->hgot;
+ h->forced_local = 0;
+ h->other = STV_DEFAULT;
+ return bfd_elf_link_record_dynamic_symbol (info, h);
}
/* Copy the extra info we tack onto an elf_link_hash_entry. */
@@ -1836,7 +1842,7 @@ allocate_plt_static (struct elf_link_hash_entry *h, void *inf)
info = inf;
htab = hppa_link_hash_table (info);
if (htab->elf.dynamic_sections_created
- && h->plt.refcount > 0)
+ && h->plt.refcount > 0)
{
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */