aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2004-02-17 10:19:24 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2004-02-17 10:19:24 +0000
commitd25aed713b6b953317601bf93df7a9a14cb39031 (patch)
tree346c710199e44f71d0990604f017664836d48344 /bfd
parentf937530551ba8561aed3e15538bb1803e99f2ee8 (diff)
downloadbinutils-d25aed713b6b953317601bf93df7a9a14cb39031.zip
binutils-d25aed713b6b953317601bf93df7a9a14cb39031.tar.gz
binutils-d25aed713b6b953317601bf93df7a9a14cb39031.tar.bz2
bfd/
* elfxx-mips.c (mips_elf_calculate_relocation): Use _bfd_elf_symbol_refs_local_p to decide whether to decay a GOT_PAGE/GOT_OFST pair to GOT_DISP/addend. (_bfd_mips_elf_check_relocs): Add a global GOT entry for GOT_PAGE relocs if the symbol wasn't defined by a regular object file. Don't check the symbol's dynindx. ld/testsuite/ * ld-mips/elf/elf-rel-xgot-{n32,n64-linux}.d: Update after 2004-02-02 changes to the way large constants are added. * ld-mips/elf/elf-rel-got-{n32,n64-linux}.d: Likewise. Adjust order of GOT entries after today's change to the handling of GOT_PAGE relocations.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog10
-rw-r--r--bfd/elfxx-mips.c28
2 files changed, 15 insertions, 23 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 04e8298..753a0f7 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,13 @@
+2004-02-17 Daniel Jacobowitz <drow@mvista.com>
+ Richard Sandiford <rsandifo@redhat.com>
+
+ * elfxx-mips.c (mips_elf_calculate_relocation): Use
+ _bfd_elf_symbol_refs_local_p to decide whether to decay
+ a GOT_PAGE/GOT_OFST pair to GOT_DISP/addend.
+ (_bfd_mips_elf_check_relocs): Add a global GOT entry for GOT_PAGE
+ relocs if the symbol wasn't defined by a regular object file.
+ Don't check the symbol's dynindx.
+
2004-02-16 Andrew Cagney <cagney@redhat.com>
* bfd-in.h (file_ptr, ufile_ptr): Configure type using
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index a296458..f072f26 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -3261,12 +3261,9 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
{
case R_MIPS_GOT_PAGE:
case R_MIPS_GOT_OFST:
- /* If this symbol got a global GOT entry, we have to decay
- GOT_PAGE/GOT_OFST to GOT_DISP/addend. */
- local_p = local_p || ! h
- || (h->root.dynindx
- < mips_elf_get_global_gotsym_index (elf_hash_table (info)
- ->dynobj));
+ /* We need to decay to GOT_DISP/addend if the symbol doesn't
+ bind locally. */
+ local_p = local_p || _bfd_elf_symbol_refs_local_p (&h->root, info, 1);
if (local_p || r_type == R_MIPS_GOT_OFST)
break;
/* Fall through. */
@@ -5384,25 +5381,10 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
hmips = (struct mips_elf_link_hash_entry *)
hmips->root.root.u.i.link;
- if ((hmips->root.root.type == bfd_link_hash_defined
- || hmips->root.root.type == bfd_link_hash_defweak)
- && hmips->root.root.u.def.section
+ if ((hmips->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
&& ! (info->shared && ! info->symbolic
&& ! (hmips->root.elf_link_hash_flags
- & ELF_LINK_FORCED_LOCAL))
- /* If we've encountered any other relocation
- referencing the symbol, we'll have marked it as
- dynamic, and, even though we might be able to get
- rid of the GOT entry should we know for sure all
- previous relocations were GOT_PAGE ones, at this
- point we can't tell, so just keep using the
- symbol as dynamic. This is very important in the
- multi-got case, since we don't decide whether to
- decay GOT_PAGE to GOT_DISP on a per-GOT basis: if
- the symbol is dynamic, we'll need a GOT entry for
- every GOT in which the symbol is referenced with
- a GOT_PAGE relocation. */
- && hmips->root.dynindx == -1)
+ & ELF_LINK_FORCED_LOCAL)))
break;
}
/* Fall through. */