diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2010-10-11 07:38:51 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2010-10-11 07:38:51 +0000 |
commit | 7106017aa4b1efb61b6439e8df298fd1d8e537d8 (patch) | |
tree | dd32dc30194d256b20566ad4895edf7951bd57a8 /bfd/elf32-arm.c | |
parent | db14366ddcd2e156e0e56cd56f6106d025502f98 (diff) | |
download | binutils-redhat-7106017aa4b1efb61b6439e8df298fd1d8e537d8.tar.gz |
* elf32-arm.c (elf32_arm_final_link_relocate)
(elf32_arm_relocate_section): Handle relocations against STN_UNDEF.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r-- | bfd/elf32-arm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 8728949ff7..9fce4b0ea4 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -7229,12 +7229,12 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, /* A branch to an undefined weak symbol is turned into a jump to the next instruction unless a PLT entry will be created. - Do the same for local undefined symbols. + Do the same for local undefined symbols (but not for STN_UNDEF). The jump to the next instruction is optimized as a NOP depending on the architecture. */ if (h ? (h->root.type == bfd_link_hash_undefweak && !(splt != NULL && h->plt.offset != (bfd_vma) -1)) - : bfd_is_und_section (sym_sec)) + : r_symndx != STN_UNDEF && bfd_is_und_section (sym_sec)) { value = (bfd_get_32 (input_bfd, hit_data) & 0xf0000000); @@ -8908,9 +8908,11 @@ elf32_arm_relocate_section (bfd * output_bfd, undefined symbol. This is a daft object file, but we should at least do something about it. V4BX & NONE relocations do not use the symbol and are explicitly - allowed to use the undefined symbol, so allow those. */ + allowed to use the undefined symbol, so allow those. + Likewise for relocations against STN_UNDEF. */ if (r_type != R_ARM_V4BX && r_type != R_ARM_NONE + && r_symndx != STN_UNDEF && bfd_is_und_section (sec) && ELF_ST_BIND (sym->st_info) != STB_WEAK) { |