]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR ld/778
authorAlan Modra <amodra@gmail.com>
Mon, 7 Mar 2005 06:01:17 +0000 (06:01 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 7 Mar 2005 06:01:17 +0000 (06:01 +0000)
* elf32-hppa.c (elf32_hppa_create_dynamic_sections): Reinstate
_GLOBAL_OFFSET_TABLE_ as a normal dynamic symbol.

bfd/ChangeLog
bfd/elf32-hppa.c

index d29f1e86a8eec14db6e74f5f524fbe72b86a268e..874c1b01662aff66236050287428c337672fad0e 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-07  Alan Modra  <amodra@bigpond.net.au>
+
+       PR ld/778
+       * elf32-hppa.c (elf32_hppa_create_dynamic_sections): Reinstate
+       _GLOBAL_OFFSET_TABLE_ as a normal dynamic symbol.
+
 2005-03-06  Alan Modra  <amodra@bigpond.net.au>
 
        * elf.c (elfcore_grok_win32pstatus): Warning fixes.
index d861847628c05c38c2987f8da6deb9405ac69a6e..592501102310af162510019c722d5e105a2f9d02 100644 (file)
@@ -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.  */