aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Daney <ddaney@avtrex.com>2005-07-29 23:24:01 +0000
committerDavid Daney <ddaney@avtrex.com>2005-07-29 23:24:01 +0000
commiteedecc0705321aba4d85787ab3901d65ad01dd76 (patch)
treea205559a48f4945c332ea769f154d9baed932512
parente9f89963c40811550748184d4792d70336f1fcc8 (diff)
downloadgdb-eedecc0705321aba4d85787ab3901d65ad01dd76.zip
gdb-eedecc0705321aba4d85787ab3901d65ad01dd76.tar.gz
gdb-eedecc0705321aba4d85787ab3901d65ad01dd76.tar.bz2
* elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Ignore _gp_disp
if it is in the *ABS* section.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfxx-mips.c14
2 files changed, 19 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b52a2ec..ef863dc 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-29 David Daney <ddaney@avtrex.com>
+
+ * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Ignore _gp_disp
+ if it is in the *ABS* section.
+
2005-07-29 Paul Brook <paul@codesourcery.com>
* reloc.c: Add BFD_RELOC_ARM_T32_ADD_PC12.
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index bd900e0..316114e 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -5414,6 +5414,20 @@ _bfd_mips_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
return TRUE;
}
+ /* Shared objects may have a dynamic symbol '_gp_disp' defined as
+ a SECTION *ABS*. This causes ld to think it can resolve _gp_disp
+ by setting a DT_NEEDED for the shared object. Since _gp_disp is
+ a magic symbol resolved by the linker, we ignore this bogus definition
+ of _gp_disp. New ABI objects do not suffer from this problem so this
+ is not done for them. */
+ if (!NEWABI_P(abfd)
+ && (sym->st_shndx == SHN_ABS)
+ && (strcmp (*namep, "_gp_disp") == 0))
+ {
+ *namep = NULL;
+ return TRUE;
+ }
+
switch (sym->st_shndx)
{
case SHN_COMMON: