OSDN Git Service

* elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Use the
authorRichard Sandiford <rsandifo@nildram.co.uk>
Mon, 27 Feb 2006 08:48:28 +0000 (08:48 +0000)
committerRichard Sandiford <rsandifo@nildram.co.uk>
Mon, 27 Feb 2006 08:48:28 +0000 (08:48 +0000)
cached hgot entry to check for _GLOBAL_OFFSET_TABLE_.
* elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise.
* elf32-bfin.c (bfin_finish_dynamic_symbol): Likewise.
* elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
* elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
* elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
* elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise.
* elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Likewise.
* elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise.
* elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise.
* elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise.
* elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise.
* elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likewise.
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
* elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.  Also use
the cached hplt entry to check for _PROCEDURE_LINKAGE_TABLE_.
* elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise.
* elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
* elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise.
* elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.

20 files changed:
bfd/ChangeLog
bfd/elf-m10300.c
bfd/elf32-arm.c
bfd/elf32-bfin.c
bfd/elf32-cris.c
bfd/elf32-hppa.c
bfd/elf32-i386.c
bfd/elf32-m32r.c
bfd/elf32-m68k.c
bfd/elf32-s390.c
bfd/elf32-sh.c
bfd/elf32-vax.c
bfd/elf32-xtensa.c
bfd/elf64-alpha.c
bfd/elf64-s390.c
bfd/elf64-sh64.c
bfd/elf64-x86-64.c
bfd/elfxx-ia64.c
bfd/elfxx-mips.c
bfd/elfxx-sparc.c

index f7cbecb..e26f318 100644 (file)
@@ -1,3 +1,27 @@
+2006-02-27  Richard Sandiford  <richard@codesourcery.com>
+
+       * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Use the
+       cached hgot entry to check for _GLOBAL_OFFSET_TABLE_.
+       * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise.
+       * elf32-bfin.c (bfin_finish_dynamic_symbol): Likewise.
+       * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
+       * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
+       * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
+       * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise.
+       * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Likewise.
+       * elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise.
+       * elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise.
+       * elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise.
+       * elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise.
+       * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likewise.
+       * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
+       * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.  Also use
+       the cached hplt entry to check for _PROCEDURE_LINKAGE_TABLE_.
+       * elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise.
+       * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
+       * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise.
+       * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
+
 2006-02-25  Richard Sandiford  <richard@codesourcery.com>
 
        * elf-bfd.h (elf_link_hash_table): Add hplt field.
index 5b14e92..81c5db0 100644 (file)
@@ -4502,7 +4502,7 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
 
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+      || h == elf_hash_table (info)->hgot)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index f988716..ef19e6e 100644 (file)
@@ -6866,7 +6866,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info,
 
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+      || h == htab->root.hgot)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index c1a1b74..c97cbb2 100644 (file)
@@ -2337,7 +2337,7 @@ fprintf(stderr, "*** check this relocation %s\n", __FUNCTION__);
     }
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+      || h == elf_hash_table (info)->hgot)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index 06865dc..3edabc7 100644 (file)
@@ -1769,7 +1769,7 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
 
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+      || h == elf_hash_table (info)->hgot)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index 89900b7..b5d6714 100644 (file)
@@ -4057,7 +4057,7 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd,
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
   if (eh->root.root.string[0] == '_'
       && (strcmp (eh->root.root.string, "_DYNAMIC") == 0
-         || strcmp (eh->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0))
+         || eh == htab->etab.hgot))
     {
       sym->st_shndx = SHN_ABS;
     }
index eb701a1..3dd28e4 100644 (file)
@@ -3638,8 +3638,7 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd,
      On VxWorks, the _GLOBAL_OFFSET_TABLE_ symbol is not absolute: it
      is relative to the ".got" section.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || (strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
-         && !htab->is_vxworks))
+      || (!htab->is_vxworks && h == htab->elf.hgot))
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index 672d5f4..aecf0fe 100644 (file)
@@ -3358,7 +3358,7 @@ m32r_elf_finish_dynamic_symbol (bfd *output_bfd,
 
   /* Mark some specially defined symbols as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+      || h == htab->root.hgot)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index 7b3a1e9..98b0b12 100644 (file)
@@ -2140,7 +2140,7 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
 
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+      || h == elf_hash_table (info)->hgot)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index afe6c76..1c52755 100644 (file)
@@ -3309,8 +3309,8 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
 
   /* Mark some specially defined symbols as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
-      || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0)
+      || h == htab->elf.hgot
+      || h == htab->elf.hplt)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index 25077cc..d03f60b 100644 (file)
@@ -7036,7 +7036,7 @@ sh_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info,
 
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+      || h == htab->root.hgot)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index 7a150ba..e0d059c 100644 (file)
@@ -1954,7 +1954,7 @@ elf_vax_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info,
 
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+      || h == elf_hash_table (info)->hgot)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index 2cafb3e..18610c7 100644 (file)
@@ -2384,7 +2384,7 @@ elf_xtensa_finish_dynamic_symbol (bfd *output_bfd ATTRIBUTE_UNUSED,
 
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+      || h == elf_hash_table (info)->hgot)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index b6cbf23..60deadb 100644 (file)
@@ -4717,8 +4717,8 @@ elf64_alpha_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info,
 
   /* Mark some specially defined symbols as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
-      || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0)
+      || h == elf_hash_table (info)->hgot
+      || h == elf_hash_table (info)->hplt)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index 83eb836..7beda9d 100644 (file)
@@ -3252,8 +3252,8 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
 
   /* Mark some specially defined symbols as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
-      || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0)
+      || h == htab->elf.hgot
+      || h == htab->elf.hplt)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index d915478..f76e916 100644 (file)
@@ -3889,7 +3889,7 @@ sh64_elf64_finish_dynamic_symbol (bfd *output_bfd,
 
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+      || h == elf_hash_table (info)->hgot)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index a35400e..8c1a712 100644 (file)
@@ -3131,7 +3131,7 @@ elf64_x86_64_finish_dynamic_symbol (bfd *output_bfd,
 
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+      || h == htab->elf.hgot)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index 409ce8b..7a0cc90 100644 (file)
@@ -4835,8 +4835,8 @@ elfNN_ia64_finish_dynamic_symbol (output_bfd, info, h, sym)
 
   /* Mark some specially defined symbols as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
-      || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0)
+      || h == ia64_info->root.hgot
+      || h == ia64_info->root.hplt)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;
index 2675ee0..89acbc5 100644 (file)
@@ -7492,7 +7492,7 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
   name = h->root.root.string;
   if (strcmp (name, "_DYNAMIC") == 0
-      || strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0)
+      || h == elf_hash_table (info)->hgot)
     sym->st_shndx = SHN_ABS;
   else if (strcmp (name, "_DYNAMIC_LINK") == 0
           || strcmp (name, "_DYNAMIC_LINKING") == 0)
index 71eed13..cdf8c83 100644 (file)
@@ -3578,8 +3578,8 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd,
 
   /* Mark some specially defined symbols as absolute.  */
   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
-      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
-      || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0)
+      || h == htab->elf.hgot
+      || h == htab->elf.hplt)
     sym->st_shndx = SHN_ABS;
 
   return TRUE;