aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2010-10-11 07:38:53 +0000
committerThomas Schwinge <tschwinge@gnu.org>2010-10-11 07:38:53 +0000
commit77b4f08fc99ba41fc75c8881ca119752ba1b9595 (patch)
treeb4ed6cf38870bc5e0285069b3f6d2b54cef87e91 /bfd
parentd92fa646e7da3c37d4bade5ee935c9e9a728c8d6 (diff)
downloadgdb-77b4f08fc99ba41fc75c8881ca119752ba1b9595.zip
gdb-77b4f08fc99ba41fc75c8881ca119752ba1b9595.tar.gz
gdb-77b4f08fc99ba41fc75c8881ca119752ba1b9595.tar.bz2
* elf32-arm.c (elf32_arm_final_link_relocate)
(elf32_arm_relocate_section): Handle relocations against STN_UNDEF.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-arm.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 35b4ce8..fcfa945 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-11 Thomas Schwinge <thomas@codesourcery.com>
+
+ * elf32-arm.c (elf32_arm_final_link_relocate)
+ (elf32_arm_relocate_section): Handle relocations against STN_UNDEF.
+
2010-10-11 Dave Korn <dave.korn.cygwin@gmail.com>
* elflink.c (_bfd_elf_link_output_relocs): Delete unused variable
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 8728949..9fce4b0 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)
{