From e7e2196da3f0157573acc1b4fa2f7a87da9f044f Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Thu, 10 Dec 2009 14:20:04 +0000 Subject: bfd/ * elfxx-mips.c (mips_elf_calculate_relocation): Correct handling of undefined symbols. ld/testsuite/ * ld-mips-elf/undefined.d: New test. * ld-mips-elf/undefined.s: Source for the new test. * ld-mips-elf/mips-elf.exp: Run the new test. --- bfd/ChangeLog | 5 +++++ bfd/elfxx-mips.c | 16 +++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2591260..1922f7e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2009-12-10 Maciej W. Rozycki + + * elfxx-mips.c (mips_elf_calculate_relocation): Correct handling + of undefined symbols. + 2009-12-09 Daniel Jacobowitz * elf32-arm.c (elf32_arm_next_input_section): Skip sections without diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 3a1c8ba..9df441d 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -4973,15 +4973,17 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf */ symbol = 0; } + else if ((*info->callbacks->undefined_symbol) + (info, h->root.root.root.string, input_bfd, + input_section, relocation->r_offset, + (info->unresolved_syms_in_objects == RM_GENERATE_ERROR) + || ELF_ST_VISIBILITY (h->root.other))) + { + return bfd_reloc_undefined; + } else { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.root.string, input_bfd, - input_section, relocation->r_offset, - (info->unresolved_syms_in_objects == RM_GENERATE_ERROR) - || ELF_ST_VISIBILITY (h->root.other)))) - return bfd_reloc_undefined; - symbol = 0; + return bfd_reloc_notsupported; } target_is_16_bit_code_p = ELF_ST_IS_MIPS16 (h->root.other); -- cgit v1.1