From 5bbc5ae7bb145ad8ccaa57c02646a7557e67c1bf Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Thu, 3 Sep 2009 18:31:00 +0000 Subject: [PATCH] * elfxx-mips.c (mips_elf_calculate_relocation): Don't relocate R_MIPS_JALR unless symbol resolves locally. --- bfd/ChangeLog | 5 +++++ bfd/elfxx-mips.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 94dc049..39987cd 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2009-09-03 Adam Nemet + * elfxx-mips.c (mips_elf_calculate_relocation): Don't relocate + R_MIPS_JALR unless symbol resolves locally. + +2009-09-03 Adam Nemet + * elfxx-mips.c (_bfd_mips_elf_check_relocs): Don't set has_static_relocs for R_MIPS_JALR. diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index cece0bc..3a1c8ba 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -5489,8 +5489,8 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, case R_MIPS_JALR: /* This relocation is only a hint. In some cases, we optimize it into a bal instruction. But we don't try to optimize - branches to the PLT; that will wind up wasting time. */ - if (h != NULL && h->root.plt.offset != (bfd_vma) -1) + when the symbol does not resolve locally. */ + if (h != NULL && !SYMBOL_CALLS_LOCAL (info, &h->root)) return bfd_reloc_continue; value = symbol + addend; break; -- 2.7.4