diff options
author | Paul Brook <paul@codesourcery.com> | 2006-02-07 03:50:20 +0000 |
---|---|---|
committer | Paul Brook <paul@codesourcery.com> | 2006-02-07 03:50:20 +0000 |
commit | 1d022697d9081c6c39c3aa950c245bff518ebce7 (patch) | |
tree | 3f6f421ee85f447b01c0cbd7db1c4c76412f3dac /ld/emultempl/armelf.em | |
parent | f31cddcbd4350c950bffee7d921942189f6087bb (diff) | |
download | gdb-1d022697d9081c6c39c3aa950c245bff518ebce7.zip gdb-1d022697d9081c6c39c3aa950c245bff518ebce7.tar.gz gdb-1d022697d9081c6c39c3aa950c245bff518ebce7.tar.bz2 |
2006-02-07 Paul Brook <paul@codesourcery.com>
ld/
* emultempl/armelf.em: Include elf/arm.h.
(arm_elf_finish): Set low address bit if enty point is a Thumb
function.
ld/testsuite/
* ld-arm/arm-elf.exp: Add thumb-entry test.
* ld-arm/thumb-entry.d: New test.
* ld-arm/thumb-entry.s: New test.
Diffstat (limited to 'ld/emultempl/armelf.em')
-rw-r--r-- | ld/emultempl/armelf.em | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em index 71498da..bd74ab5 100644 --- a/ld/emultempl/armelf.em +++ b/ld/emultempl/armelf.em @@ -26,6 +26,8 @@ test -z "$TARGET2_TYPE" && TARGET2_TYPE="rel" cat >>e${EMULATION_NAME}.c <<EOF +#include "elf/arm.h" + static char *thumb_entry_symbol = NULL; static bfd *bfd_for_interwork; static int byteswap_code = 0; @@ -150,11 +152,25 @@ arm_elf_finish (void) /* Call the elf32.em routine. */ gld${EMULATION_NAME}_finish (); - if (thumb_entry_symbol == NULL) - return; + if (thumb_entry_symbol) + { + h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, + FALSE, FALSE, TRUE); + } + else + { + struct elf_link_hash_entry * eh; + + if (!entry_symbol.name) + return; + + h = bfd_link_hash_lookup (link_info.hash, entry_symbol.name, + FALSE, FALSE, TRUE); + eh = (struct elf_link_hash_entry *)h; + if (!h || ELF_ST_TYPE(eh->type) != STT_ARM_TFUNC) + return; + } - h = bfd_link_hash_lookup (link_info.hash, thumb_entry_symbol, - FALSE, FALSE, TRUE); if (h != (struct bfd_link_hash_entry *) NULL && (h->type == bfd_link_hash_defined @@ -180,7 +196,8 @@ arm_elf_finish (void) sprintf_vma (buffer + 2, val); - if (entry_symbol.name != NULL && entry_from_cmdline) + if (thumb_entry_symbol != NULL && entry_symbol.name != NULL + && entry_from_cmdline) einfo (_("%P: warning: '--thumb-entry %s' is overriding '-e %s'\n"), thumb_entry_symbol, entry_symbol.name); entry_symbol.name = buffer; |