diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 29 |
2 files changed, 29 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0739367..894c497 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2009-04-17 Christophe Lyon <christophe.lyon@st.com> + + * elf32-arm.c (elf32_arm_size_stubs): Handle long branches through + PLT entries to an undefined symbol when generating a shared + library. + 2009-04-17 Nick Clifton <nickc@redhat.com> PR 9909 diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 99beb9e..2f49b7e 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -3832,12 +3832,29 @@ elf32_arm_size_stubs (bfd *output_bfd, + sym_sec->output_offset + sym_sec->output_section->vma); } - else if (hash->root.root.type == bfd_link_hash_undefweak - || hash->root.root.type == bfd_link_hash_undefined) - /* For a shared library, these will need a PLT stub, - which is treated separately. - For absolute code, they cannot be handled. */ - continue; + else if ((hash->root.root.type == bfd_link_hash_undefined) + || (hash->root.root.type == bfd_link_hash_undefweak)) + { + /* For a shared library, use the PLT stub as + target address to decide whether a long + branch stub is needed. + For absolute code, they cannot be handled. */ + struct elf32_arm_link_hash_table *globals = + elf32_arm_hash_table (info); + + if (globals->splt != NULL && hash != NULL + && hash->root.plt.offset != (bfd_vma) -1) + { + sym_sec = globals->splt; + sym_value = hash->root.plt.offset; + if (sym_sec->output_section != NULL) + destination = (sym_value + + sym_sec->output_offset + + sym_sec->output_section->vma); + } + else + continue; + } else { bfd_set_error (bfd_error_bad_value); |