From e30d1fa1bfb1ff2e225cfac9226c357f2cf07a26 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 28 Nov 2018 19:35:04 +0000 Subject: Add R_AARCH64_P32_MOVW_PREL_* ELF32 relocs These ilp32 relocations were missing for some reason. bfd/ChangeLog: * elfnn-aarch64.c: Enable MOVW_PREL relocs for ELF32. include/ChangeLog: * elf/aarch64.h (R_AARCH64_P32_MOVW_PREL_G0): Define. (R_AARCH64_P32_MOVW_PREL_G0_NC): Define. (R_AARCH64_P32_MOVW_PREL_G1): Define. ld/ChangeLog: * testsuite/ld-aarch64/aarch64-elf.exp: Add emit-relocs-22 and -23. * testsuite/ld-aarch64/emit-relocs-22.d: New test. * testsuite/ld-aarch64/emit-relocs-22.s: New test. * testsuite/ld-aarch64/emit-relocs-23.d: New test. * testsuite/ld-aarch64/emit-relocs-23.s: New test. --- ld/ChangeLog | 8 ++++++++ ld/testsuite/ld-aarch64/aarch64-elf.exp | 2 ++ ld/testsuite/ld-aarch64/emit-relocs-22.d | 15 +++++++++++++++ ld/testsuite/ld-aarch64/emit-relocs-22.s | 3 +++ ld/testsuite/ld-aarch64/emit-relocs-23.d | 15 +++++++++++++++ ld/testsuite/ld-aarch64/emit-relocs-23.s | 3 +++ 6 files changed, 46 insertions(+) create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-22.d create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-22.s create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-23.d create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-23.s (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index 9f38cc2..e5c85e1 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2019-06-14 Szabolcs Nagy + + * testsuite/ld-aarch64/aarch64-elf.exp: Add emit-relocs-22 and -23. + * testsuite/ld-aarch64/emit-relocs-22.d: New test. + * testsuite/ld-aarch64/emit-relocs-22.s: New test. + * testsuite/ld-aarch64/emit-relocs-23.d: New test. + * testsuite/ld-aarch64/emit-relocs-23.s: New test. + 2019-06-14 Alan Modra * Makefile.in: Regenerate. diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp index d0a588c..ab8d152 100644 --- a/ld/testsuite/ld-aarch64/aarch64-elf.exp +++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp @@ -96,6 +96,8 @@ run_dump_test "erratum843419-no-args" # Relocation Tests run_dump_test_lp64 "weak-undefined" +run_dump_test "emit-relocs-22" +run_dump_test "emit-relocs-23" run_dump_test "emit-relocs-28" run_dump_test "emit-relocs-86" run_dump_test "emit-relocs-86-overflow" diff --git a/ld/testsuite/ld-aarch64/emit-relocs-22.d b/ld/testsuite/ld-aarch64/emit-relocs-22.d new file mode 100644 index 0000000..b1e69e0 --- /dev/null +++ b/ld/testsuite/ld-aarch64/emit-relocs-22.d @@ -0,0 +1,15 @@ +#source: emit-relocs-22.s +#as: -mabi=ilp32 +#ld: -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld --defsym foo1=0x12345 --defsym foo2=0x1234 -e0 --emit-relocs +#objdump: -dr + +.*: +file format .* + + +Disassembly of section \.text: + +.* <\.text>: + +10000: 528468ad mov w13, #0x2345 // #9029 + +10000: R_AARCH64_P32_MOVW_PREL_G0 foo1 + +10004: 129db9f1 mov w17, #0xffff1230 // #-60880 + +10004: R_AARCH64_P32_MOVW_PREL_G0 foo2 diff --git a/ld/testsuite/ld-aarch64/emit-relocs-22.s b/ld/testsuite/ld-aarch64/emit-relocs-22.s new file mode 100644 index 0000000..1b7870b --- /dev/null +++ b/ld/testsuite/ld-aarch64/emit-relocs-22.s @@ -0,0 +1,3 @@ +.text + movz w13, :prel_g0:foo1 + movz w17, :prel_g0:foo2 diff --git a/ld/testsuite/ld-aarch64/emit-relocs-23.d b/ld/testsuite/ld-aarch64/emit-relocs-23.d new file mode 100644 index 0000000..abb939d --- /dev/null +++ b/ld/testsuite/ld-aarch64/emit-relocs-23.d @@ -0,0 +1,15 @@ +#source: emit-relocs-23.s +#as: -mabi=ilp32 +#ld: -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld --defsym foo=0x12345678 -e0 --emit-relocs +#objdump: -dr + +.*: +file format .* + + +Disassembly of section \.text: + +.* <\.text>: + +10000: 728acf0d movk w13, #0x5678 + +10000: R_AARCH64_P32_MOVW_PREL_G0_NC foo + +10004: 52a24671 mov w17, #0x12330000 // #305332224 + +10004: R_AARCH64_P32_MOVW_PREL_G1 foo diff --git a/ld/testsuite/ld-aarch64/emit-relocs-23.s b/ld/testsuite/ld-aarch64/emit-relocs-23.s new file mode 100644 index 0000000..f9c5869 --- /dev/null +++ b/ld/testsuite/ld-aarch64/emit-relocs-23.s @@ -0,0 +1,3 @@ +.text + movk w13, :prel_g0_nc:foo + movz w17, :prel_g1:foo -- cgit v1.1