aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2006-02-27 08:48:28 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2006-02-27 08:48:28 +0000
commit22edb2f16480aef5e060ad021199c3086300a4f5 (patch)
treea25af03f4d94ce245ea5f4934c3636c4668f77c9
parent691342f948aa4f8c4f4e039669276faf753a36b4 (diff)
downloadgdb-22edb2f16480aef5e060ad021199c3086300a4f5.zip
gdb-22edb2f16480aef5e060ad021199c3086300a4f5.tar.gz
gdb-22edb2f16480aef5e060ad021199c3086300a4f5.tar.bz2
* 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.
-rw-r--r--bfd/ChangeLog24
-rw-r--r--bfd/elf-m10300.c2
-rw-r--r--bfd/elf32-arm.c2
-rw-r--r--bfd/elf32-bfin.c2
-rw-r--r--bfd/elf32-cris.c2
-rw-r--r--bfd/elf32-hppa.c2
-rw-r--r--bfd/elf32-i386.c3
-rw-r--r--bfd/elf32-m32r.c2
-rw-r--r--bfd/elf32-m68k.c2
-rw-r--r--bfd/elf32-s390.c4
-rw-r--r--bfd/elf32-sh.c2
-rw-r--r--bfd/elf32-vax.c2
-rw-r--r--bfd/elf32-xtensa.c2
-rw-r--r--bfd/elf64-alpha.c4
-rw-r--r--bfd/elf64-s390.c4
-rw-r--r--bfd/elf64-sh64.c2
-rw-r--r--bfd/elf64-x86-64.c2
-rw-r--r--bfd/elfxx-ia64.c4
-rw-r--r--bfd/elfxx-mips.c2
-rw-r--r--bfd/elfxx-sparc.c4
20 files changed, 48 insertions, 25 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f7cbecb..e26f318 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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.
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index 5b14e92..81c5db0 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -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;
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index f988716..ef19e6e 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -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;
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index c1a1b74..c97cbb2 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -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;
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 06865dc..3edabc7 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -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;
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 89900b7..b5d6714 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -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;
}
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index eb701a1..3dd28e4 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -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;
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index 672d5f4..aecf0fe 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -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;
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 7b3a1e9..98b0b12 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -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;
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index afe6c76..1c52755 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -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;
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 25077cc..d03f60b 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -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;
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index 7a150ba..e0d059c 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -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;
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 2cafb3e..18610c7 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -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;
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index b6cbf23..60deadb 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -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;
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 83eb836..7beda9d 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -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;
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index d915478..f76e916 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -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;
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index a35400e..8c1a712 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -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;
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index 409ce8b..7a0cc90 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -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;
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 2675ee08..89acbc5 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -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)
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index 71eed13..cdf8c83 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -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;