# readelf: Apply readelf options on result. Compare with regex (last arg).
set aarch64elftests {
- {"EH Frame merge" "-Ttext 0x8000" "" "" {eh-frame-bar.s eh-frame-foo.s}
- {{objdump --dwarf=frames eh-frame.d}} "eh-frame"}
{"Erratum 835769 dump test"
"--fix-cortex-a53-835769" "" "" {erratum835769.s}
{{objdump -dr erratum835769.d}}
return "aarch64elf32"
}
+proc aarch64_choose_lp64_emul {} {
+ if [istarget *linux*] then {
+ if [istarget aarch64_be-*] {
+ return "aarch64linuxb"
+ }
+ return "aarch64linux"
+ }
+ if [istarget aarch64_be-*] {
+ return "aarch64elfb"
+ }
+ return "aarch64elf"
+}
+
+proc run_dump_test_lp64 { testname } {
+ run_dump_test $testname \
+ [list [list as "-mabi=lp64"] \
+ [list ld [concat "-m " [aarch64_choose_lp64_emul]]]]
+}
+
+set eh-frame-merge-lp64 [list [list "EH Frame merge" \
+ [concat "-m " [aarch64_choose_lp64_emul] \
+ " -Ttext 0x8000"] \
+ "" "-mabi=lp64" {eh-frame-bar.s eh-frame-foo.s} \
+ {{objdump --dwarf=frames eh-frame.d}} \
+ "eh-frame"]]
+
run_ld_link_tests $aarch64elftests
+run_ld_link_tests eh-frame-merge-lp64
+
run_dump_test "erratum843419"
# Relocation Tests
-run_dump_test "weak-undefined"
+run_dump_test_lp64 "weak-undefined"
run_dump_test "emit-relocs-28"
run_dump_test "emit-relocs-86"
run_dump_test "emit-relocs-86-overflow"
run_dump_test "emit-relocs-90"
run_dump_test "emit-relocs-90-overflow"
run_dump_test "emit-relocs-92"
-run_dump_test "emit-relocs-257"
-run_dump_test "emit-relocs-257-be"
+run_dump_test_lp64 "emit-relocs-257"
+run_dump_test_lp64 "emit-relocs-257-be"
# 258 is tested in 257
# 259 is tested in 257
-run_dump_test "emit-relocs-260"
-run_dump_test "emit-relocs-260-be"
+run_dump_test_lp64 "emit-relocs-260"
+run_dump_test_lp64 "emit-relocs-260-be"
# 261 is tested by 260
-run_dump_test "emit-relocs-262"
-run_dump_test "emit-relocs-263"
-run_dump_test "emit-relocs-264"
-run_dump_test "emit-relocs-264-bad"
-run_dump_test "emit-relocs-265"
-run_dump_test "emit-relocs-266"
-run_dump_test "emit-relocs-266-bad"
-run_dump_test "emit-relocs-267"
-run_dump_test "emit-relocs-268"
-run_dump_test "emit-relocs-268-bad"
-run_dump_test "emit-relocs-269"
-run_dump_test "emit-relocs-269-bad"
-run_dump_test "emit-relocs-270"
-run_dump_test "emit-relocs-270-bad"
-run_dump_test "emit-relocs-270-overflow"
-run_dump_test "emit-relocs-271"
-run_dump_test "emit-relocs-271-overflow"
-run_dump_test "emit-relocs-272"
-run_dump_test "emit-relocs-272-overflow"
-run_dump_test "emit-relocs-273"
-run_dump_test "emit-relocs-274"
-run_dump_test "emit-relocs-275"
-run_dump_test "emit-relocs-276"
-run_dump_test "emit-relocs-277"
-run_dump_test "emit-relocs-278"
-run_dump_test "emit-relocs-279"
-run_dump_test "emit-relocs-279-bad"
-run_dump_test "emit-relocs-280"
+run_dump_test_lp64 "emit-relocs-262"
+run_dump_test_lp64 "emit-relocs-263"
+run_dump_test_lp64 "emit-relocs-264"
+run_dump_test_lp64 "emit-relocs-264-bad"
+run_dump_test_lp64 "emit-relocs-265"
+run_dump_test_lp64 "emit-relocs-266"
+run_dump_test_lp64 "emit-relocs-266-bad"
+run_dump_test_lp64 "emit-relocs-267"
+run_dump_test_lp64 "emit-relocs-268"
+run_dump_test_lp64 "emit-relocs-268-bad"
+run_dump_test_lp64 "emit-relocs-269"
+run_dump_test_lp64 "emit-relocs-269-bad"
+run_dump_test_lp64 "emit-relocs-270"
+run_dump_test_lp64 "emit-relocs-270-bad"
+run_dump_test_lp64 "emit-relocs-270-overflow"
+run_dump_test_lp64 "emit-relocs-271"
+run_dump_test_lp64 "emit-relocs-271-overflow"
+run_dump_test_lp64 "emit-relocs-272"
+run_dump_test_lp64 "emit-relocs-272-overflow"
+run_dump_test_lp64 "emit-relocs-273"
+run_dump_test_lp64 "emit-relocs-274"
+run_dump_test_lp64 "emit-relocs-275"
+run_dump_test_lp64 "emit-relocs-276"
+run_dump_test_lp64 "emit-relocs-277"
+run_dump_test_lp64 "emit-relocs-278"
+run_dump_test_lp64 "emit-relocs-279"
+run_dump_test_lp64 "emit-relocs-279-bad"
+run_dump_test_lp64 "emit-relocs-280"
# 281 is unused
-run_dump_test "emit-relocs-282"
-run_dump_test "emit-relocs-283"
-run_dump_test "emit-relocs-284"
-run_dump_test "emit-relocs-285"
-run_dump_test "emit-relocs-286"
-run_dump_test "emit-relocs-286-bad"
+run_dump_test_lp64 "emit-relocs-282"
+run_dump_test_lp64 "emit-relocs-283"
+run_dump_test_lp64 "emit-relocs-284"
+run_dump_test_lp64 "emit-relocs-285"
+run_dump_test_lp64 "emit-relocs-286"
+run_dump_test_lp64 "emit-relocs-286-bad"
# 287-298 are not done yet
-run_dump_test "emit-relocs-299"
+run_dump_test_lp64 "emit-relocs-299"
# 300 is not done yet
-run_dump_test "emit-relocs-301"
-run_dump_test "emit-relocs-301-be"
-run_dump_test "emit-relocs-302"
-run_dump_test "emit-relocs-302-be"
+run_dump_test_lp64 "emit-relocs-301"
+run_dump_test_lp64 "emit-relocs-301-be"
+run_dump_test_lp64 "emit-relocs-302"
+run_dump_test_lp64 "emit-relocs-302-be"
# 303-308 are not done yet
-run_dump_test "emit-relocs-309-up"
-run_dump_test "emit-relocs-309-low"
-run_dump_test "emit-relocs-309-up-bad"
-run_dump_test "emit-relocs-309-low-bad"
-run_dump_test "emit-relocs-310"
-run_dump_test "emit-relocs-310-be"
-run_dump_test "emit-relocs-311"
-run_dump_test "emit-relocs-312"
-run_dump_test "emit-relocs-313"
-run_dump_test "emit-relocs-515"
-run_dump_test "emit-relocs-515-be"
-run_dump_test "emit-relocs-516"
-run_dump_test "emit-relocs-516-be"
-run_dump_test "emit-relocs-523"
-run_dump_test "emit-relocs-524"
-run_dump_test "emit-relocs-525"
-run_dump_test "emit-relocs-526"
-run_dump_test "emit-relocs-526-overflow"
-run_dump_test "emit-relocs-527"
-run_dump_test "emit-relocs-528"
-run_dump_test "emit-relocs-528-overflow"
-run_dump_test "emit-relocs-529"
-run_dump_test "emit-relocs-529-overflow"
-run_dump_test "emit-relocs-530"
-run_dump_test "emit-relocs-531"
-run_dump_test "emit-relocs-531-overflow"
-run_dump_test "emit-relocs-532"
-run_dump_test "emit-relocs-533"
-run_dump_test "emit-relocs-533-overflow"
-run_dump_test "emit-relocs-534"
-run_dump_test "emit-relocs-535"
-run_dump_test "emit-relocs-535-overflow"
-run_dump_test "emit-relocs-536"
-run_dump_test "emit-relocs-537"
-run_dump_test "emit-relocs-537-overflow"
-run_dump_test "emit-relocs-538"
+run_dump_test_lp64 "emit-relocs-309-up"
+run_dump_test_lp64 "emit-relocs-309-low"
+run_dump_test_lp64 "emit-relocs-309-up-bad"
+run_dump_test_lp64 "emit-relocs-309-low-bad"
+run_dump_test_lp64 "emit-relocs-310"
+run_dump_test_lp64 "emit-relocs-310-be"
+run_dump_test_lp64 "emit-relocs-311"
+run_dump_test_lp64 "emit-relocs-312"
+run_dump_test_lp64 "emit-relocs-313"
+run_dump_test_lp64 "emit-relocs-515"
+run_dump_test_lp64 "emit-relocs-515-be"
+run_dump_test_lp64 "emit-relocs-516"
+run_dump_test_lp64 "emit-relocs-516-be"
+run_dump_test_lp64 "emit-relocs-523"
+run_dump_test_lp64 "emit-relocs-524"
+run_dump_test_lp64 "emit-relocs-525"
+run_dump_test_lp64 "emit-relocs-526"
+run_dump_test_lp64 "emit-relocs-526-overflow"
+run_dump_test_lp64 "emit-relocs-527"
+run_dump_test_lp64 "emit-relocs-528"
+run_dump_test_lp64 "emit-relocs-528-overflow"
+run_dump_test_lp64 "emit-relocs-529"
+run_dump_test_lp64 "emit-relocs-529-overflow"
+run_dump_test_lp64 "emit-relocs-530"
+run_dump_test_lp64 "emit-relocs-531"
+run_dump_test_lp64 "emit-relocs-531-overflow"
+run_dump_test_lp64 "emit-relocs-532"
+run_dump_test_lp64 "emit-relocs-533"
+run_dump_test_lp64 "emit-relocs-533-overflow"
+run_dump_test_lp64 "emit-relocs-534"
+run_dump_test_lp64 "emit-relocs-535"
+run_dump_test_lp64 "emit-relocs-535-overflow"
+run_dump_test_lp64 "emit-relocs-536"
+run_dump_test_lp64 "emit-relocs-537"
+run_dump_test_lp64 "emit-relocs-537-overflow"
+run_dump_test_lp64 "emit-relocs-538"
run_dump_test "reloc-overflow-bad"
# test addend correctness when --emit-relocs specified for non-relocatable obj.
-run_dump_test "emit-relocs-local-addend"
+run_dump_test_lp64 "emit-relocs-local-addend"
# test addend correctness when -r specified.
-run_dump_test "local-addend-r"
+run_dump_test_lp64 "local-addend-r"
# test error handling on pcrel relocation for shared libraries.
-run_dump_test "pcrel_pic_undefined"
-run_dump_test "pcrel_pic_defined_local"
+run_dump_test_lp64 "pcrel_pic_undefined"
+run_dump_test_lp64 "pcrel_pic_defined_local"
run_dump_test "limit-b"
run_dump_test "limit-bl"
run_dump_test "tls-relax-gdesc-le"
run_dump_test "tls-relax-gd-ie-ilp32"
run_dump_test "tls-relax-gd-ie"
-run_dump_test "tls-relax-large-gd-ie"
-run_dump_test "tls-relax-large-gd-ie-be"
-run_dump_test "tls-relax-large-gd-le"
-run_dump_test "tls-relax-large-gd-le-be"
-run_dump_test "tls-relax-large-desc-ie"
-run_dump_test "tls-relax-large-desc-ie-be"
-run_dump_test "tls-relax-large-desc-le"
-run_dump_test "tls-relax-large-desc-le-be"
+run_dump_test_lp64 "tls-relax-large-gd-ie"
+run_dump_test_lp64 "tls-relax-large-gd-ie-be"
+run_dump_test_lp64 "tls-relax-large-gd-le"
+run_dump_test_lp64 "tls-relax-large-gd-le-be"
+run_dump_test_lp64 "tls-relax-large-desc-ie"
+run_dump_test_lp64 "tls-relax-large-desc-ie-be"
+run_dump_test_lp64 "tls-relax-large-desc-le"
+run_dump_test_lp64 "tls-relax-large-desc-le-be"
run_dump_test "tls-relax-gdesc-ie"
run_dump_test "tls-relax-ie-le"
run_dump_test "tls-relax-ld-le-small"
run_dump_test "tls-tiny-desc-ie"
run_dump_test "tls-tiny-desc-le"
run_dump_test "tls-tiny-ie"
-run_dump_test "tls-large-ie"
-run_dump_test "tls-large-ie-be"
-run_dump_test "tls-large-desc"
-run_dump_test "tls-large-desc-be"
+run_dump_test_lp64 "tls-large-ie"
+run_dump_test_lp64 "tls-large-ie-be"
+run_dump_test_lp64 "tls-large-desc"
+run_dump_test_lp64 "tls-large-desc-be"
run_dump_test "tls-tiny-ld"
run_dump_test "tls-small-ld"
-run_dump_test "tlsle"
+run_dump_test_lp64 "tlsle"
run_dump_test "tlsle-symbol-offset"
run_dump_test "gc-got-relocs"
run_dump_test "gc-tls-relocs"
-run_dump_test "gc-plt-relocs"
-run_dump_test "gc-relocs-257-dyn"
-run_dump_test "gc-relocs-257"
+run_dump_test_lp64 "gc-plt-relocs"
+run_dump_test_lp64 "gc-relocs-257-dyn"
+run_dump_test_lp64 "gc-relocs-257"
run_dump_test "implicit_got_section_1"
run_dump_test "pr17415"
-run_dump_test "tprel_g2_overflow"
+run_dump_test_lp64 "tprel_g2_overflow"
run_dump_test "tprel_add_lo12_overflow"
run_dump_test "protected-data"
run_dump_test "ifunc-7b"
run_dump_test "ifunc-7c"
run_dump_test "ifunc-8"
-run_dump_test "ifunc-9"
-run_dump_test "ifunc-10"
-run_dump_test "ifunc-11"
-run_dump_test "ifunc-12"
-run_dump_test "ifunc-13"
+run_dump_test_lp64 "ifunc-9"
+run_dump_test_lp64 "ifunc-10"
+run_dump_test_lp64 "ifunc-11"
+run_dump_test_lp64 "ifunc-12"
+run_dump_test_lp64 "ifunc-13"
run_dump_test "ifunc-14a"
run_dump_test "ifunc-14b"
run_dump_test "ifunc-14c"
run_dump_test "ifunc-16"
run_dump_test "ifunc-17a"
run_dump_test "ifunc-17b"
-run_dump_test "ifunc-18a"
-run_dump_test "ifunc-18b"
-run_dump_test "ifunc-19a"
-run_dump_test "ifunc-19b"
-run_dump_test "ifunc-20"
-run_dump_test "ifunc-21"
-run_dump_test "ifunc-22"
+run_dump_test_lp64 "ifunc-18a"
+run_dump_test_lp64 "ifunc-18b"
+run_dump_test_lp64 "ifunc-19a"
+run_dump_test_lp64 "ifunc-19b"
+run_dump_test_lp64 "ifunc-20"
+run_dump_test_lp64 "ifunc-21"
+run_dump_test_lp64 "ifunc-22"
run_dump_test "relasz"
-run_dump_test "relocs-1027-symbolic-func"
+run_dump_test_lp64 "relocs-1027-symbolic-func"
-run_dump_test "dt_textrel"
+run_dump_test_lp64 "dt_textrel"
run_dump_test "plt_mapping_symbol"
-run_dump_test "rela-abs-relative"
-run_dump_test "rela-abs-relative-be"
-run_dump_test "rela-abs-relative-opt"
+run_dump_test_lp64 "rela-abs-relative"
+run_dump_test_lp64 "rela-abs-relative-be"
+run_dump_test_lp64 "rela-abs-relative-opt"
-run_dump_test "pie-bind-locally"
+run_dump_test_lp64 "pie-bind-locally"
set aarch64elflinktests {
{"ld-aarch64/so with global symbol" "-shared" "" "" {copy-reloc-so.s}
Disassembly of section .e843419:
-0000000020000000 <e843419>:
- 20000000: d10043ff sub sp, sp, #0x10
- 20000004: d28001a7 mov x7, #0xd // #13
- 20000008: b9000fe7 str w7, \[sp, #12\]
- 2000000c: 140003fb b 20000ff8 <e843419_1>
+0*20000000 <e843419>:
+[ ]*20000000: d10043ff sub sp, sp, #0x10
+[ ]*20000004: d28001a7 mov x7, #0xd // #13
+[ ]*20000008: b9000fe7 str w7, \[sp, #12\]
+[ ]*2000000c: 140003fb b 20000ff8 <e843419_1>
...
-0000000020000ff8 <e843419_1>:
- 20000ff8: 90100000 adrp x0, 40000000 <[_a-zA-z0-9]+>
- 20000ffc: f800c007 stur x7, \[x0, #12\]
- 20001000: d2800128 mov x8, #0x9 // #9
- 20001004: 14000008 b 20001024 <e843419@0002_00000013_1004>
- 20001008: 8b050020 add x0, x1, x5
- 2000100c: b9400fe7 ldr w7, \[sp, #12\]
- 20001010: 0b0700e0 add w0, w7, w7
- 20001014: 910043ff add sp, sp, #0x10
- 20001018: 14000005 b 2000102c <__e835769_veneer>
- 2000101c: d65f03c0 ret
- 20001020: 14000400 b 20002020 <__e835769_veneer\+0xff4>
+0*20000ff8 <e843419_1>:
+[ ]*20000ff8: 90100000 adrp x0, 40000000 <[_a-zA-z0-9]+>
+[ ]*20000ffc: f800c007 stur x7, \[x0, #12\]
+[ ]*20001000: d2800128 mov x8, #0x9 // #9
+[ ]*20001004: 14000008 b 20001024 <e843419@0002_00000013_1004>
+[ ]*20001008: 8b050020 add x0, x1, x5
+[ ]*2000100c: b9400fe7 ldr w7, \[sp, #12\]
+[ ]*20001010: 0b0700e0 add w0, w7, w7
+[ ]*20001014: 910043ff add sp, sp, #0x10
+[ ]*20001018: 14000005 b 2000102c <__e835769_veneer>
+[ ]*2000101c: d65f03c0 ret
+[ ]*20001020: 14000400 b 20002020 <__e835769_veneer\+0xff4>
-0000000020001024 <e843419@0002_00000013_1004>:
- 20001024: f9000008 str x8, \[x0\]
- 20001028: 17fffff8 b 20001008 <e843419_1\+0x10>
+0*20001024 <e843419@0002_00000013_1004>:
+[ ]*20001024: f9000008 str x8, \[x0\]
+[ ]*20001028: 17fffff8 b 20001008 <e843419_1\+0x10>
-000000002000102c <__e835769_veneer>:
- 2000102c: f0f17ff0 adrp x16, 3000000 <e835769>
- 20001030: 91000210 add x16, x16, #0x0
- 20001034: d61f0200 br x16
+0*2000102c <__e835769_veneer>:
+[ ]*2000102c: f0f17ff0 adrp x16, 3000000 <e835769>
+[ ]*20001030: 91000210 add x16, x16, #0x0
+[ ]*20001034: d61f0200 br x16
...
Disassembly of section .e835769:
-0000000003000000 <e835769>:
- 3000000: b8408c87 ldr w7, \[x4, #8\]!
- 3000004: 1b017c06 mul w6, w0, w1
- 3000008: f9400084 ldr x4, \[x4\]
- 300000c: 14000004 b 300001c <__erratum_835769_veneer_0>
- 3000010: aa0503e0 mov x0, x5
- 3000014: d65f03c0 ret
- 3000018: 14000400 b 3001018 <__erratum_835769_veneer_0\+0xffc>
+0*3000000 <e835769>:
+[ ]*3000000: b8408c87 ldr w7, \[x4, #8\]!
+[ ]*3000004: 1b017c06 mul w6, w0, w1
+[ ]*3000008: f9400084 ldr x4, \[x4\]
+[ ]*300000c: 14000004 b 300001c <__erratum_835769_veneer_0>
+[ ]*3000010: aa0503e0 mov x0, x5
+[ ]*3000014: d65f03c0 ret
+[ ]*3000018: 14000400 b 3001018 <__erratum_835769_veneer_0\+0xffc>
-000000000300001c <__erratum_835769_veneer_0>:
- 300001c: 9b031845 madd x5, x2, x3, x6
- 3000020: 17fffffc b 3000010 <e835769\+0x10>
+0*300001c <__erratum_835769_veneer_0>:
+[ ]*300001c: 9b031845 madd x5, x2, x3, x6
+[ ]*3000020: 17fffffc b 3000010 <e835769\+0x10>
...
Disassembly of section .text:
-0000000000400000 <main>:
- 400000: d10043ff sub sp, sp, #0x10
- 400004: d28001a7 mov x7, #0xd // #13
- 400008: b9000fe7 str w7, \[sp, #12\]
- 40000c: 14000003 b 400018 <__e843419_veneer>
- 400010: d65f03c0 ret
- 400014: 14000400 b 401014 <__e843419_veneer\+0xffc>
+0*400000 <main>:
+[ ]*400000: d10043ff sub sp, sp, #0x10
+[ ]*400004: d28001a7 mov x7, #0xd // #13
+[ ]*400008: b9000fe7 str w7, \[sp, #12\]
+[ ]*40000c: 14000003 b 400018 <__e843419_veneer>
+[ ]*400010: d65f03c0 ret
+[ ]*400014: 14000400 b 401014 <__e843419_veneer\+0xffc>
-0000000000400018 <__e843419_veneer>:
- 400018: 900fe010 adrp x16, 20000000 <e843419>
- 40001c: 91000210 add x16, x16, #0x0
- 400020: d61f0200 br x16
+0*400018 <__e843419_veneer>:
+[ ]*400018: 900fe010 adrp x16, 20000000 <e843419>
+[ ]*40001c: 91000210 add x16, x16, #0x0
+[ ]*400020: d61f0200 br x16
...