From 1d022697d9081c6c39c3aa950c245bff518ebce7 Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Tue, 7 Feb 2006 03:50:20 +0000 Subject: [PATCH] 2006-02-07 Paul Brook 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. --- ld/ChangeLog | 6 ++++++ ld/emultempl/armelf.em | 27 ++++++++++++++++++++++----- ld/testsuite/ChangeLog | 6 ++++++ ld/testsuite/ld-arm/arm-elf.exp | 3 +++ ld/testsuite/ld-arm/thumb-entry.d | 3 +++ ld/testsuite/ld-arm/thumb-entry.s | 8 ++++++++ 6 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 ld/testsuite/ld-arm/thumb-entry.d create mode 100644 ld/testsuite/ld-arm/thumb-entry.s diff --git a/ld/ChangeLog b/ld/ChangeLog index 81a0e398158..2cb4fd08bcf 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2006-02-07 Paul Brook + + * emultempl/armelf.em: Include elf/arm.h. + (arm_elf_finish): Set low address bit if enty point is a Thumb + function. + 2006-02-01 Danny Smith * deffilep.y (def_image_name): If the image name does not have diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em index 71498da1b33..bd74ab5705b 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 <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; diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index f7e13cdf4fe..d1692eda703 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2006-02-07 Paul Brook + + * ld-arm/arm-elf.exp: Add thumb-entry test. + * ld-arm/thumb-entry.d: New test. + * ld-arm/thumb-entry.s: New test. + 2006-02-04 Richard Sandiford * ld-mips-elf/tls-hidden2a.s, ld-mips-elf/tls-hidden2b.s, diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp index 384b2899baf..76a743e1f2e 100644 --- a/ld/testsuite/ld-arm/arm-elf.exp +++ b/ld/testsuite/ld-arm/arm-elf.exp @@ -89,6 +89,9 @@ set armelftests { {"TLS dynamic application" "-T arm-dyn.ld tmpdir/tls-lib.so" "" {tls-app.s} {{objdump -fdw tls-app.d} {objdump -Rw tls-app.r}} "tls-app"} + {"Thumb entry point" "-T arm.ld" "" {thumb-entry.s} + {{readelf -h thumb-entry.d}} + "thumb-entry"} } run_ld_link_tests $armelftests diff --git a/ld/testsuite/ld-arm/thumb-entry.d b/ld/testsuite/ld-arm/thumb-entry.d new file mode 100644 index 00000000000..602fd6cfb70 --- /dev/null +++ b/ld/testsuite/ld-arm/thumb-entry.d @@ -0,0 +1,3 @@ +#... + Entry point address: 0x8001 +#... diff --git a/ld/testsuite/ld-arm/thumb-entry.s b/ld/testsuite/ld-arm/thumb-entry.s new file mode 100644 index 00000000000..5b3659d9c0e --- /dev/null +++ b/ld/testsuite/ld-arm/thumb-entry.s @@ -0,0 +1,8 @@ + .text + .arch armv4t + .thumb + .global _start + .thumb_func +_start: + bx lr + -- 2.30.2