From d4df96e6ca31377d190eed7312b61e072f90a24a Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 5 Jun 2002 06:50:16 +0000 Subject: [PATCH] 2002-06-05 H.J. Lu * elfxx-mips.c (mips_elf_calculate_relocation): Call _bfd_elf_rel_local_sym for STT_SECTION relocations against the SEC_MERGE section. --- bfd/ChangeLog | 6 ++++++ bfd/elfxx-mips.c | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f37865dbe13..b0ca9d0c901 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2002-06-05 H.J. Lu + + * elfxx-mips.c (mips_elf_calculate_relocation): Call + _bfd_elf_rel_local_sym for STT_SECTION relocations against + the SEC_MERGE section. + 2002-06-05 Alan Modra * coff-alpha.c: Update copyright date. diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 67179ee18d9..08e1abbcd70 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -2082,8 +2082,16 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info, sec = local_sections[r_symndx]; symbol = sec->output_section->vma + sec->output_offset; - if (ELF_ST_TYPE (sym->st_info) != STT_SECTION) + if (ELF_ST_TYPE (sym->st_info) != STT_SECTION + || (sec->flags & SEC_MERGE)) symbol += sym->st_value; + if ((sec->flags & SEC_MERGE) + && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + addend = _bfd_elf_rel_local_sym (abfd, sym, &sec, addend); + addend -= symbol; + addend += sec->output_section->vma + sec->output_offset; + } /* MIPS16 text labels should be treated as odd. */ if (sym->st_other == STO_MIPS16) -- 2.30.2