diff options
author | Nick Clifton <nickc@redhat.com> | 2013-07-18 11:24:11 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2013-07-18 11:24:11 +0000 |
commit | 7a89b94e91a52b13d59638ca8d733f841c7fdbdb (patch) | |
tree | 06f28bcfe1bb523193a89ed01ac9791bc7551c96 /ld | |
parent | 9f758fdc2205450850c83e10a231cc434807c333 (diff) | |
download | binutils-gdb-7a89b94e91a52b13d59638ca8d733f841c7fdbdb.tar.gz |
* elf32-arm.c (elf32_arm_stub_long_branch_arm_nacl): New variable.
(elf32_arm_stub_long_branch_arm_nacl_pic): New variable.
(arm_build_one_stub): Increase MAXRELOCS to 3.
(arm_type_of_stub): Use them if GLOBALS->nacl_p.
(struct elf32_arm_link_hash_table): Give add_stub_section member's
pointee type a third argument.
(elf32_arm_create_or_find_stub_sec): Update caller.
(elf32_arm_size_stubs): Update argument type.
* bfd-in.h (elf32_arm_size_stubs): Update decl.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* emultempl/armelf.em (elf32_arm_add_stub_section): Take third
argument ALIGNMENT_POWER, use it instead of constant 3.
* ld-arm/farcall-arm-nacl.d: New file.
* ld-arm/farcall-arm-nacl-pic.d: New file.
* ld-arm/farcall-data-nacl.d: New file.
* ld-arm/arm-elf.exp (armeabitests_common): Add extra element to
"action" lists for those cases to use a different dump file for NaCl
targets.
Massage $armeabitests_common to drop the extra element or the one
before it, depending on [istarget "arm*-*-nacl*"].
* ld-arm/arm-elf.exp (armelftests_common): Move all "Cortex-A8
erratum fix", Thumb-only and interworking cases to ...
(armelftests_nonacl): ... here.
(armeabitests_common): Move all "erratum 760522 fix", Thumb-only
and interworking cases to ...
(armeabitests_nonacl): ... here.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/emultempl/armelf.em | 11 | ||||
-rw-r--r-- | ld/testsuite/ChangeLog | 18 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/arm-elf.exp | 372 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/farcall-arm-nacl-pic.d | 20 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/farcall-arm-nacl.d | 20 | ||||
-rw-r--r-- | ld/testsuite/ld-arm/farcall-data-nacl.d | 24 |
7 files changed, 293 insertions, 177 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 08ac0857ea8..f5671b4e99e 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2013-07-18 Roland McGrath <mcgrathr@google.com> + + * emultempl/armelf.em (elf32_arm_add_stub_section): Take third + argument ALIGNMENT_POWER, use it instead of constant 3. + 2013-07-08 Jeff Law <law@redhat.com> * scripttempl/elf.sc: Handle function names and other text after diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em index 7f7d2cc00f6..eee6af1259c 100644 --- a/ld/emultempl/armelf.em +++ b/ld/emultempl/armelf.em @@ -1,7 +1,5 @@ # This shell script emits a C file. -*- C -*- -# Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -# 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -# Free Software Foundation, Inc. +# Copyright 1991-2013 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -184,8 +182,9 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) immediately after INPUT_SECTION. */ static asection * -elf32_arm_add_stub_section (const char *stub_sec_name, - asection *input_section) +elf32_arm_add_stub_section (const char * stub_sec_name, + asection * input_section, + unsigned int alignment_power) { asection *stub_sec; flagword flags; @@ -201,7 +200,7 @@ elf32_arm_add_stub_section (const char *stub_sec_name, if (stub_sec == NULL) goto err_ret; - bfd_set_section_alignment (stub_file->the_bfd, stub_sec, 3); + bfd_set_section_alignment (stub_file->the_bfd, stub_sec, alignment_power); output_section = input_section->output_section; secname = bfd_get_section_name (output_section->owner, output_section); diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index febe6910422..652474d7f3f 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,21 @@ +2013-07-18 Roland McGrath <mcgrathr@google.com> + + * ld-arm/farcall-arm-nacl.d: New file. + * ld-arm/farcall-arm-nacl-pic.d: New file. + * ld-arm/farcall-data-nacl.d: New file. + * ld-arm/arm-elf.exp (armeabitests_common): Add extra element to + "action" lists for those cases to use a different dump file for NaCl + targets. + Massage $armeabitests_common to drop the extra element or the one + before it, depending on [istarget "arm*-*-nacl*"]. + + * ld-arm/arm-elf.exp (armelftests_common): Move all "Cortex-A8 + erratum fix", Thumb-only and interworking cases to ... + (armelftests_nonacl): ... here. + (armeabitests_common): Move all "erratum 760522 fix", Thumb-only + and interworking cases to ... + (armeabitests_nonacl): ... here. + 2013-07-12 Maciej W. Rozycki <macro@codesourcery.com> * ld-mips-elf/nan-2008.d: New test. diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp index fd8a5993a9f..dda9251a46f 100644 --- a/ld/testsuite/ld-arm/arm-elf.exp +++ b/ld/testsuite/ld-arm/arm-elf.exp @@ -70,9 +70,6 @@ set armelftests_common { {"Group relocations" "-Ttext 0x8000 --section-start zero=0x0 --section-start alpha=0xeef0 --section-start beta=0xffeef0" "" "" {group-relocs.s} {{objdump -dr group-relocs.d}} "group-relocs"} - {"Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x401000" "" "" {thumb1-bl.s} - {{objdump -dr thumb1-bl.d}} - "thumb1-bl"} {"Indirect cross-library function reference (set-up)" "-shared" "" "" {arm-lib-plt-2a.s} {} @@ -144,12 +141,6 @@ set armelftests_common { {"TLS local PIC symbol static link" "-T arm.ld" "" "" {tls-local-static.s} {{objdump -fdw tls-local-static.d}} "tls-local-static"} - {"Thumb entry point" "-T arm.ld" "" "" {thumb-entry.s} - {{readelf -h thumb-entry.d}} - "thumb-entry"} - {"thumb-rel32" "-static -T arm.ld" "" "" {thumb-rel32.s} - {{objdump -s thumb-rel32.d}} - "thumb-rel32"} {"MOVW/MOVT" "-static -T arm.ld" "" "" {arm-movwt.s} {{objdump -dw arm-movwt.d}} "arm-movwt"} @@ -168,79 +159,9 @@ set armelftests_common { "-EL --vfp11-denorm-fix=scalar -Ttext=0x8000" "" "-EL -mfpu=vfpxd" {vfp11-fix-none.s} {{objdump -dr vfp11-fix-none.d}} "vfp11-fix-none"} - {"Cortex-A8 erratum fix, b.w" - "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-b.s} - {{objdump -dr cortex-a8-fix-b.d}} - "cortex-a8-fix-b"} - {"Cortex-A8 erratum fix, bl.w" - "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-bl.s} - {{objdump -dr cortex-a8-fix-bl.d}} - "cortex-a8-fix-bl"} - {"Cortex-A8 erratum fix, bcc.w" - "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-bcc.s} - {{objdump -dr cortex-a8-fix-bcc.d}} - "cortex-a8-fix-bcc"} - {"Cortex-A8 erratum fix, blx.w" - "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-blx.s} - {{objdump -dr cortex-a8-fix-blx.d}} - "cortex-a8-fix-blx"} - {"Cortex-A8 erratum fix, relocate b.w to ARM" - "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-b-rel.s} - {{objdump -dr cortex-a8-fix-b-rel-arm.d}} - "cortex-a8-fix-b-rel-arm"} - {"Cortex-A8 erratum fix, relocate b.w to Thumb" - "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-b-rel.s} - {{objdump -dr cortex-a8-fix-b-rel-thumb.d}} - "cortex-a8-fix-b-rel-thumb"} - {"Cortex-A8 erratum fix, relocate bl.w to ARM" - "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-bl-rel.s} - {{objdump -dr cortex-a8-fix-bl-rel-arm.d}} - "cortex-a8-fix-bl-rel-arm"} - {"Cortex-A8 erratum fix, relocate bl.w to Thumb" - "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bl-rel.s} - {{objdump -dr cortex-a8-fix-bl-rel-thumb.d}} - "cortex-a8-fix-bl-rel-thumb"} - {"Cortex-A8 erratum fix, relocate b<cond>.w to Thumb" - "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bcc-rel.s} - {{objdump -dr cortex-a8-fix-bcc-rel-thumb.d}} - "cortex-a8-fix-bcc-rel-thumb"} - {"Cortex-A8 erratum fix, relocate blx.w to ARM" - "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-blx-rel.s} - {{objdump -dr cortex-a8-fix-blx-rel-arm.d}} - "cortex-a8-fix-blx-rel-arm"} - {"Cortex-A8 erratum fix, relocate blx.w to Thumb" - "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-blx-rel.s} - {{objdump -dr cortex-a8-fix-blx-rel-thumb.d}} - "cortex-a8-fix-blx-rel-thumb"} - {"Cortex-A8 erratum fix, relocate bl.w and far call" - "-EL -Ttext=0x00 --fix-cortex-a8 --defsym _start=0" "" - "-EL -mcpu=cortex-a8" {cortex-a8-far-1.s cortex-a8-far-2.s cortex-a8-far-3.s} - {{objdump -dr cortex-a8-far.d}} - "cortex-a8-far"} - {"Cortex-A8 erratum fix, headers" - "-EL --fix-cortex-a8 -T cortex-a8-fix-hdr.t" "" - "-EL -mcpu=cortex-a8" {cortex-a8-fix-hdr.s} - {{objdump -dr cortex-a8-fix-hdr.d}} - "cortex-a8-fix-hdr"} - {"Cortex-A8 erratum fix, blx.w and b<cond>.w together" - "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-blx-bcond.s} - {{objdump -dr cortex-a8-fix-blx-bcond.d}} - "cortex-a8-fix-blx-bcond"} {"Unwinding and -gc-sections" "-gc-sections" "" "" {gc-unwind.s} {{objdump -sj.data gc-unwind.d}} "gc-unwind"} - {"Thumb and -gc-sections" "-shared -T arm-dyn.ld" "" "" {gc-thumb-lib.s} - {} - "gc-thumb-lib.so"} - {"Thumb and -gc-sections" "-pie -T arm.ld -gc-sections tmpdir/gc-thumb-lib.so" "" "" {gc-thumb.s} - {{readelf --relocs gc-thumb.d}} - "gc-thumb"} - {"arm-pic-veneer" "-static -T arm.ld --pic-veneer" "" "" {arm-pic-veneer.s} - {{objdump -d arm-pic-veneer.d}} - "arm-pic-veneer"} - {"jump19" "-static -T arm.ld" "" "" {jump19.s} - {{objdump -dr jump19.d}} - "jump19"} {"script-type" "-static -T script-type.ld" "" "" {script-type.s} {{readelf -s script-type.sym}} "script-type"} @@ -291,6 +212,28 @@ set armelftests_common { } set armelftests_nonacl { + {"Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x401000" "" "" {thumb1-bl.s} + {{objdump -dr thumb1-bl.d}} + "thumb1-bl"} + {"Thumb entry point" "-T arm.ld" "" "" {thumb-entry.s} + {{readelf -h thumb-entry.d}} + "thumb-entry"} + {"thumb-rel32" "-static -T arm.ld" "" "" {thumb-rel32.s} + {{objdump -s thumb-rel32.d}} + "thumb-rel32"} + {"jump19" "-static -T arm.ld" "" "" {jump19.s} + {{objdump -dr jump19.d}} + "jump19"} + {"Thumb and -gc-sections" "-shared -T arm-dyn.ld" "" "" {gc-thumb-lib.s} + {} + "gc-thumb-lib.so"} + {"Thumb and -gc-sections" "-pie -T arm.ld -gc-sections tmpdir/gc-thumb-lib.so" "" "" {gc-thumb.s} + {{readelf --relocs gc-thumb.d}} + "gc-thumb"} + {"arm-pic-veneer" "-static -T arm.ld --pic-veneer" "" "" {arm-pic-veneer.s} + {{objdump -d arm-pic-veneer.d}} + "arm-pic-veneer"} + {"Simple non-PIC shared library" "-shared" "" "" {arm-lib.s} {{objdump -fdw arm-lib.d} {objdump -Rw arm-lib.r}} "arm-lib.so"} @@ -343,6 +286,64 @@ set armelftests_nonacl { {"TLS shared library gdesc local" "--no-fix-arm1176 -shared -T arm-dyn.ld" "" "" {tls-lib-loc.s} {{objdump -fdw tls-lib-loc.d} {objdump -Rw tls-lib-loc.r}} "tls-lib-loc.so"} + {"Cortex-A8 erratum fix, b.w" + "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-b.s} + {{objdump -dr cortex-a8-fix-b.d}} + "cortex-a8-fix-b"} + {"Cortex-A8 erratum fix, bl.w" + "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-bl.s} + {{objdump -dr cortex-a8-fix-bl.d}} + "cortex-a8-fix-bl"} + {"Cortex-A8 erratum fix, bcc.w" + "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-bcc.s} + {{objdump -dr cortex-a8-fix-bcc.d}} + "cortex-a8-fix-bcc"} + {"Cortex-A8 erratum fix, blx.w" + "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-blx.s} + {{objdump -dr cortex-a8-fix-blx.d}} + "cortex-a8-fix-blx"} + {"Cortex-A8 erratum fix, relocate b.w to ARM" + "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-b-rel.s} + {{objdump -dr cortex-a8-fix-b-rel-arm.d}} + "cortex-a8-fix-b-rel-arm"} + {"Cortex-A8 erratum fix, relocate b.w to Thumb" + "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-b-rel.s} + {{objdump -dr cortex-a8-fix-b-rel-thumb.d}} + "cortex-a8-fix-b-rel-thumb"} + {"Cortex-A8 erratum fix, relocate bl.w to ARM" + "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-bl-rel.s} + {{objdump -dr cortex-a8-fix-bl-rel-arm.d}} + "cortex-a8-fix-bl-rel-arm"} + {"Cortex-A8 erratum fix, relocate bl.w to Thumb" + "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bl-rel.s} + {{objdump -dr cortex-a8-fix-bl-rel-thumb.d}} + "cortex-a8-fix-bl-rel-thumb"} + {"Cortex-A8 erratum fix, relocate b<cond>.w to Thumb" + "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bcc-rel.s} + {{objdump -dr cortex-a8-fix-bcc-rel-thumb.d}} + "cortex-a8-fix-bcc-rel-thumb"} + {"Cortex-A8 erratum fix, relocate blx.w to ARM" + "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-blx-rel.s} + {{objdump -dr cortex-a8-fix-blx-rel-arm.d}} + "cortex-a8-fix-blx-rel-arm"} + {"Cortex-A8 erratum fix, relocate blx.w to Thumb" + "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-blx-rel.s} + {{objdump -dr cortex-a8-fix-blx-rel-thumb.d}} + "cortex-a8-fix-blx-rel-thumb"} + {"Cortex-A8 erratum fix, relocate bl.w and far call" + "-EL -Ttext=0x00 --fix-cortex-a8 --defsym _start=0" "" + "-EL -mcpu=cortex-a8" {cortex-a8-far-1.s cortex-a8-far-2.s cortex-a8-far-3.s} + {{objdump -dr cortex-a8-far.d}} + "cortex-a8-far"} + {"Cortex-A8 erratum fix, headers" + "-EL --fix-cortex-a8 -T cortex-a8-fix-hdr.t" "" + "-EL -mcpu=cortex-a8" {cortex-a8-fix-hdr.s} + {{objdump -dr cortex-a8-fix-hdr.d}} + "cortex-a8-fix-hdr"} + {"Cortex-A8 erratum fix, blx.w and b<cond>.w together" + "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-blx-bcond.s} + {{objdump -dr cortex-a8-fix-blx-bcond.d}} + "cortex-a8-fix-blx-bcond"} {"Cortex-A8 erratum fix, b.w to PLT" "-EL -Tcortex-a8-fix-plt.ld --fix-cortex-a8 -shared" "" "-EL" {cortex-a8-fix-b-plt.s} @@ -494,7 +495,13 @@ if { ![istarget "arm*-*-*eabi*"] && ![istarget "arm*-*-nacl*"] } { return } -# Farcalls stubs are fully supported for ARM-EABI only +# Farcalls stubs are fully supported for ARM-EABI only. +# This list is massaged below into run_ld_link_tests standard format. +# The source list is almost that same format. The one difference is +# that each "action" (elements of element 5) might have four elements +# instead of three; in that case, the fourth element is the name of +# the dump file to use for arm*-*nacl* targets instead of the canonical +# dump file (the third element). set armeabitests_common { {"EABI attribute merging" "-r" "" "" {attr-merge.s attr-merge.s} {{readelf -A attr-merge.attr}} @@ -532,114 +539,29 @@ set armeabitests_common { {"EABI attribute arch merging 2 reversed" "-r" "" "" {arch-v6.s arch-v6k.s} {{readelf -A attr-merge-arch-2.attr}} "attr-merge-arch-2r"} - {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x1001000" "" "" {thumb2-bl.s} - {{objdump -dr thumb2-bl.d}} - "thumb2-bl"} - {"Thumb-2 Interworked branch" "-T arm.ld" "" "" {thumb2-b-interwork.s} - {{objdump -dr thumb2-b-interwork.d}} - "thumb2-b-interwork"} - {"BL/BLX interworking" "-T arm.ld" "" "" {thumb2-bl-blx-interwork.s} - {{objdump -dr thumb2-bl-blx-interwork.d}} - "thumb2-bl-blx-interwork"} - {"ARMv4 interworking" "-static -T arm.ld --fix-v4bx-interworking" "" "--fix-v4bx -meabi=4" {armv4-bx.s} - {{objdump -d armv4-bx.d}} - "armv4-bx"} {"MOVW/MOVT and merged sections" "-T arm.ld" "" "" {movw-merge.s} {{objdump -dw movw-merge.d}} "movw-merge"} {"MOVW/MOVT against shared libraries" "tmpdir/arm-lib.so" "" "" {arm-app-movw.s} {{objdump -Rw arm-app.r}} "arm-app-movw"} - {"Thumb-2-as-Thumb-1 BL" "--no-fix-arm1176 -Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-as-thumb1-bad.s} - {{objdump -d thumb2-bl-as-thumb1-bad.d}} - "thumb2-bl-as-thumb1-bad"} - {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-bad.s} - {{objdump -d thumb2-bl-bad.d}} - "thumb2-bl-bad"} - {"Branch to linker script symbol with BL for thumb-only target" "-T branch-lks-sym.ld" "" "" {thumb-bl-lks-sym.s} - {{objdump -d thumb-bl-lks-sym.d}} - "thumb-bl-lks-sym"} - {"Branch to linker script symbol with B for thumb-only target" "-T branch-lks-sym.ld" "" "" {thumb-b-lks-sym.s} - {{objdump -d thumb-b-lks-sym.d}} - "thumb-b-lks-sym"} {"ARM-ARM farcall" "-Ttext 0x1000 --section-start .foo=0x2001020" "" "" {farcall-arm-arm.s} - {{objdump -d farcall-arm-arm.d}} + {{objdump -d farcall-arm-arm.d farcall-arm-nacl.d}} "farcall-arm-arm"} {"ARM-ARM farcall (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001020 --pic-veneer" "" "" {farcall-arm-arm.s} - {{objdump -d farcall-arm-arm-pic-veneer.d}} + {{objdump -d farcall-arm-arm-pic-veneer.d farcall-arm-nacl-pic.d}} "farcall-arm-arm-pic-veneer"} {"ARM-ARM farcall (BE8)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB --be8" "" "-EB" {farcall-arm-arm.s} - {{objdump -d farcall-arm-arm.d}} + {{objdump -d farcall-arm-arm.d farcall-arm-nacl.d}} "farcall-arm-arm-be8"} {"ARM-ARM farcall (BE)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB" "" "-EB" {farcall-arm-arm.s} - {{objdump -d farcall-arm-arm.d}} + {{objdump -d farcall-arm-arm.d farcall-arm-nacl.d}} "farcall-arm-arm-be"} - {"Multiple farcalls" "-Ttext 0x1000 --section-start .foo=0x2002020" "" "" {farcall-mix.s} - {{objdump -d farcall-mix.d}} - "farcall-mix"} - {"Multiple farcalls from several sections" "-Ttext 0x1000 --section-start .mytext=0x2000 --section-start .foo=0x2003020" "" "" {farcall-mix2.s} - {{objdump -d farcall-mix2.d}} - "farcall-mix2"} - - {"Default group size" "-Ttext 0x1000 --section-start .foo=0x2003020" "" "" {farcall-group.s farcall-group2.s} - {{objdump -d farcall-group.d}} - "farcall-group-default"} - {"Group size=2" "-Ttext 0x1000 --section-start .foo=0x2003020 --stub-group-size=2" "" "" {farcall-group.s farcall-group2.s} - {{objdump -d farcall-group-size2.d}} - "farcall-group-size2"} - {"Group size limit" "-Ttext 0x1000 --section-start .far=0x2003020" "" "" {farcall-group3.s farcall-group4.s} - {{objdump -d farcall-group-limit.d}} - "farcall-group-limit"} - {"Long branch with mixed text and data" "-T arm.ld" "" "" {farcall-data.s} - {{objdump -dr farcall-data.d}} + {{objdump -dr farcall-data.d farcall-data-nacl.d}} "farcall-data"} - - {"R_ARM_THM_JUMP24 Relocation veneers: Short 1" - "--no-fix-arm1176 --section-start destsect=0x00009000 --section-start .text=0x8000" "" - "-march=armv7-a -mthumb" - {jump-reloc-veneers.s} - {{objdump -d jump-reloc-veneers-short1.d}} - "jump-reloc-veneers-short1"} - {"R_ARM_THM_JUMP24 Relocation veneers: Short 2" - "--no-fix-arm1176 --section-start destsect=0x00900000 --section-start .text=0x8000" "" - "-march=armv7-a -mthumb" - {jump-reloc-veneers.s} - {{objdump -d jump-reloc-veneers-short2.d}} - "jump-reloc-veneers-short2"} - {"R_ARM_THM_JUMP24 Relocation veneers: Long" - "--no-fix-arm1176 --section-start destsect=0x09000000 --section-start .text=0x8000" "" - "-march=armv7-a -mthumb" - {jump-reloc-veneers.s} - {{objdump -d jump-reloc-veneers-long.d}} - "jump-reloc-veneers-long"} - - {"erratum 760522 fix (default for v6z)" "--section-start=.foo=0x2001014" "" - "-march=armv6z" {fix-arm1176.s} - {{objdump -d fix-arm1176-on.d}} - "fix-arm1176-1"} - {"erratum 760522 fix (explicitly on at v6z)" "--section-start=.foo=0x2001014 --fix-arm1176" "" - "-march=armv6z" {fix-arm1176.s} - {{objdump -d fix-arm1176-on.d}} - "fix-arm1176-2"} - {"erratum 760522 fix (explicitly off at v6z)" "--section-start=.foo=0x2001014 --no-fix-arm1176" "" - "-march=armv6z" {fix-arm1176.s} - {{objdump -d fix-arm1176-off.d}} - "fix-arm1176-3"} - {"erratum 760522 fix (default for v5)" "--section-start=.foo=0x2001014 " "" - "-march=armv5te" {fix-arm1176.s} - {{objdump -d fix-arm1176-on.d}} - "fix-arm1176-4"} - {"erratum 760522 fix (default for v7-a)" "--section-start=.foo=0x2001014 " "" - "-march=armv7-a" {fix-arm1176.s} - {{objdump -d fix-arm1176-off.d}} - "fix-arm1176-5"} - {"erratum 760522 fix (default for ARM1156)" "--section-start=.foo=0x2001014 " "" - "-mcpu=arm1156t2f-s" {fix-arm1176.s} - {{objdump -d fix-arm1176-off.d}} - "fix-arm1176-6"} } set armeabitests_nonacl { @@ -700,6 +622,13 @@ set armeabitests_nonacl { {{objdump -d farcall-thumb-arm-pic-veneer.d}} "farcall-thumb-arm-pic-veneer"} + {"Multiple farcalls" "-Ttext 0x1000 --section-start .foo=0x2002020" "" "" {farcall-mix.s} + {{objdump -d farcall-mix.d}} + "farcall-mix"} + {"Multiple farcalls from several sections" "-Ttext 0x1000 --section-start .mytext=0x2000 --section-start .foo=0x2003020" "" "" {farcall-mix2.s} + {{objdump -d farcall-mix2.d}} + "farcall-mix2"} + {"Mixed ARM/Thumb dynamic application with farcalls" "tmpdir/mixed-lib.so -T arm-dyn.ld --section-start .far_arm=0x2100000 --section-start .far_thumb=0x2200000" "" "" {farcall-mixed-app.s} {{objdump -fdw farcall-mixed-app.d} {objdump -Rw farcall-mixed-app.r} @@ -721,6 +650,86 @@ set armeabitests_nonacl { {{objdump -fdw farcall-mixed-lib.d}} "farcall-mixed-lib.so"} + {"Thumb-2-as-Thumb-1 BL" "--no-fix-arm1176 -Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-as-thumb1-bad.s} + {{objdump -d thumb2-bl-as-thumb1-bad.d}} + "thumb2-bl-as-thumb1-bad"} + {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-bad.s} + {{objdump -d thumb2-bl-bad.d}} + "thumb2-bl-bad"} + {"Branch to linker script symbol with BL for thumb-only target" "-T branch-lks-sym.ld" "" "" {thumb-bl-lks-sym.s} + {{objdump -d thumb-bl-lks-sym.d}} + "thumb-bl-lks-sym"} + {"Branch to linker script symbol with B for thumb-only target" "-T branch-lks-sym.ld" "" "" {thumb-b-lks-sym.s} + {{objdump -d thumb-b-lks-sym.d}} + "thumb-b-lks-sym"} + + {"erratum 760522 fix (default for v6z)" "--section-start=.foo=0x2001014" "" + "-march=armv6z" {fix-arm1176.s} + {{objdump -d fix-arm1176-on.d}} + "fix-arm1176-1"} + {"erratum 760522 fix (explicitly on at v6z)" "--section-start=.foo=0x2001014 --fix-arm1176" "" + "-march=armv6z" {fix-arm1176.s} + {{objdump -d fix-arm1176-on.d}} + "fix-arm1176-2"} + {"erratum 760522 fix (explicitly off at v6z)" "--section-start=.foo=0x2001014 --no-fix-arm1176" "" + "-march=armv6z" {fix-arm1176.s} + {{objdump -d fix-arm1176-off.d}} + "fix-arm1176-3"} + {"erratum 760522 fix (default for v5)" "--section-start=.foo=0x2001014 " "" + "-march=armv5te" {fix-arm1176.s} + {{objdump -d fix-arm1176-on.d}} + "fix-arm1176-4"} + {"erratum 760522 fix (default for v7-a)" "--section-start=.foo=0x2001014 " "" + "-march=armv7-a" {fix-arm1176.s} + {{objdump -d fix-arm1176-off.d}} + "fix-arm1176-5"} + {"erratum 760522 fix (default for ARM1156)" "--section-start=.foo=0x2001014 " "" + "-mcpu=arm1156t2f-s" {fix-arm1176.s} + {{objdump -d fix-arm1176-off.d}} + "fix-arm1176-6"} + + {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x1001000" "" "" {thumb2-bl.s} + {{objdump -dr thumb2-bl.d}} + "thumb2-bl"} + {"Thumb-2 Interworked branch" "-T arm.ld" "" "" {thumb2-b-interwork.s} + {{objdump -dr thumb2-b-interwork.d}} + "thumb2-b-interwork"} + {"BL/BLX interworking" "-T arm.ld" "" "" {thumb2-bl-blx-interwork.s} + {{objdump -dr thumb2-bl-blx-interwork.d}} + "thumb2-bl-blx-interwork"} + {"ARMv4 interworking" "-static -T arm.ld --fix-v4bx-interworking" "" "--fix-v4bx -meabi=4" {armv4-bx.s} + {{objdump -d armv4-bx.d}} + "armv4-bx"} + + {"R_ARM_THM_JUMP24 Relocation veneers: Short 1" + "--no-fix-arm1176 --section-start destsect=0x00009000 --section-start .text=0x8000" "" + "-march=armv7-a -mthumb" + {jump-reloc-veneers.s} + {{objdump -d jump-reloc-veneers-short1.d}} + "jump-reloc-veneers-short1"} + {"R_ARM_THM_JUMP24 Relocation veneers: Short 2" + "--no-fix-arm1176 --section-start destsect=0x00900000 --section-start .text=0x8000" "" + "-march=armv7-a -mthumb" + {jump-reloc-veneers.s} + {{objdump -d jump-reloc-veneers-short2.d}} + "jump-reloc-veneers-short2"} + {"R_ARM_THM_JUMP24 Relocation veneers: Long" + "--no-fix-arm1176 --section-start destsect=0x09000000 --section-start .text=0x8000" "" + "-march=armv7-a -mthumb" + {jump-reloc-veneers.s} + {{objdump -d jump-reloc-veneers-long.d}} + "jump-reloc-veneers-long"} + + {"Default group size" "-Ttext 0x1000 --section-start .foo=0x2003020" "" "" {farcall-group.s farcall-group2.s} + {{objdump -d farcall-group.d}} + "farcall-group-default"} + {"Group size=2" "-Ttext 0x1000 --section-start .foo=0x2003020 --stub-group-size=2" "" "" {farcall-group.s farcall-group2.s} + {{objdump -d farcall-group-size2.d}} + "farcall-group-size2"} + {"Group size limit" "-Ttext 0x1000 --section-start .far=0x2003020" "" "" {farcall-group3.s farcall-group4.s} + {{objdump -d farcall-group-limit.d}} + "farcall-group-limit"} + {"TLS gnu shared library" "--no-fix-arm1176 -shared -T arm-dyn.ld" "" "" {tls-gdesc.s} {{objdump -fdw tls-gdesc.d} {objdump -Rw tls-gdesc.r}} "tls-lib2.so"} @@ -738,8 +747,29 @@ set armeabitests_nonacl { "tls-thumb1"} } +# Massage the $armeabitests_common list into run_ld_link_tests standard form. +# See the comment before 'set armeabitests_common', above. +set elide_action_elt 3 +set is_nacl [istarget "arm*-*-nacl*"] +if {$is_nacl} { + set elide_action_elt 2 +} +set neabi_common [llength $armeabitests_common] +for {set i 0} {$i < $neabi_common} {incr i} { + set case [lindex $armeabitests_common $i] + set actions [lindex $case 5] + set nactions [llength $actions] + for {set j 0} {$j < $nactions} {incr j} { + set action [lindex $actions $j] + if {[llength $action] == 4} { + set action [lreplace $action $elide_action_elt $elide_action_elt] + lset armeabitests_common $i 5 $j $action + } + } +} + run_ld_link_tests $armeabitests_common -if { ![istarget "arm*-*-nacl*"] } { +if { !$is_nacl } { run_ld_link_tests $armeabitests_nonacl } diff --git a/ld/testsuite/ld-arm/farcall-arm-nacl-pic.d b/ld/testsuite/ld-arm/farcall-arm-nacl-pic.d new file mode 100644 index 00000000000..62d342121f3 --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-arm-nacl-pic.d @@ -0,0 +1,20 @@ +.*: file format .* + +Disassembly of section \.text: + +0+1000 <_start>: +\s*1000:\s+eb000002\s+bl\s+1010 <__bar_veneer> +#... + +0+1010 <__bar_veneer>: +\s*1010:\s+e59fc00c\s+ldr\s+ip, \[pc, #12\]\s+; 1024 <__bar_veneer\+0x14> +\s*1014:\s+e08cc00f\s+add\s+ip, ip, pc +\s*1018:\s+e3ccc13f\s+bic\s+ip, ip, #-1073741809\s+; 0xc000000f +\s*101c:\s+e12fff1c\s+bx\s+ip +\s*1020:\s+e125be70\s+bkpt\s+0x5be0 +\s*1024:\s+02000004\s+.word\s+0x02000004 +#... + +\s*Disassembly of section \.foo: +\s*02001020 <bar>: +\s*2001020:\s+e12fff1e\s+bx\s+lr diff --git a/ld/testsuite/ld-arm/farcall-arm-nacl.d b/ld/testsuite/ld-arm/farcall-arm-nacl.d new file mode 100644 index 00000000000..58f2a58c4be --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-arm-nacl.d @@ -0,0 +1,20 @@ +.*: file format .* + +Disassembly of section \.text: + +0+1000 <_start>: +\s*1000:\s+eb000002\s+bl\s+1010 <__bar_veneer> +#... + +0+1010 <__bar_veneer>: +\s*1010:\s+e59fc00c\s+ldr\s+ip, \[pc, #12\]\s+; 1024 <__bar_veneer\+0x14> +\s*1014:\s+e3ccc13f\s+bic\s+ip, ip, #-1073741809\s+; 0xc000000f +\s*1018:\s+e12fff1c\s+bx\s+ip +\s*101c:\s+e320f000\s+nop\s+\{0\} +\s*1020:\s+e125be70\s+bkpt\s+0x5be0 +\s*1024:\s+02001020\s+.word\s+0x02001020 +#... + +\s*Disassembly of section \.foo: +\s*02001020 <bar>: +\s*2001020:\s+e12fff1e\s+bx\s+lr diff --git a/ld/testsuite/ld-arm/farcall-data-nacl.d b/ld/testsuite/ld-arm/farcall-data-nacl.d new file mode 100644 index 00000000000..1524fa67aba --- /dev/null +++ b/ld/testsuite/ld-arm/farcall-data-nacl.d @@ -0,0 +1,24 @@ +.*: file format .* + +Disassembly of section .text: + +0+8000 <_start>: +\s*8000:\s+ea000002\s+b\s+8010 <__far_veneer> +#... + +0+8010 <__far_veneer>: +\s*8010:\s+e59fc00c\s+ldr\s+ip, \[pc, #12\]\s+; 8024 <__far_veneer\+0x14> +\s*8014:\s+e3ccc13f\s+bic\s+ip, ip, #-1073741809\s+; 0xc000000f +\s*8018:\s+e12fff1c\s+bx\s+ip +\s*801c:\s+e320f000\s+nop\s+\{0\} +\s*8020:\s+e125be70\s+bkpt\s+0x5be0 +\s*8024:\s+12340000\s+.word\s+0x12340000 +#... + +0+8030 <after>: +\s*8030:\s+11111111\s+\.word\s+0x11111111 + +Disassembly of section \.far: + +12340000 <far>: +12340000:\s+e12fff1e\s+bx\s+lr |