diff options
author | Ben Cheng <bccheng@google.com> | 2014-03-26 11:03:35 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2014-03-26 11:03:35 -0700 |
commit | 09797ba54abf3683ea66eedddf6afbe7653f9cb9 (patch) | |
tree | 8030b2ed79c7463c89d6da294782e9d503c84f50 /binutils-2.24/ld/testsuite/ld-aarch64 | |
parent | 5a2caf34e4995860baf405552163df288000b7bf (diff) | |
download | toolchain_binutils-09797ba54abf3683ea66eedddf6afbe7653f9cb9.zip toolchain_binutils-09797ba54abf3683ea66eedddf6afbe7653f9cb9.tar.gz toolchain_binutils-09797ba54abf3683ea66eedddf6afbe7653f9cb9.tar.bz2 |
Initial checkin of binutils 2.24.
Change-Id: I0dfcbae6608dded6c3586bf5f4ac27e9612e70a2
Diffstat (limited to 'binutils-2.24/ld/testsuite/ld-aarch64')
206 files changed, 3121 insertions, 0 deletions
diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/aarch64-elf.exp b/binutils-2.24/ld/testsuite/ld-aarch64/aarch64-elf.exp new file mode 100644 index 0000000..5c150dd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/aarch64-elf.exp @@ -0,0 +1,157 @@ +# Expect script for various AARCH64 ELF tests. +# Copyright 2009-2013 Free Software Foundation, Inc. +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. + +# Exclude non-aarch64-ELF targets. +if { ![is_elf_format] || ![istarget "aarch64*-*-*"] } { + return +} + +# List contains test-items with 3 items followed by 2 lists: +# 0:name 1:ld early options 2:ld late options 3:assembler options +# 4:filenames of assembler files 5: action and options. 6: name of output file + +# Actions: +# objdump: Apply objdump options on result. Compare with regex (last arg). +# nm: Apply nm options on result. Compare with regex (last arg). +# 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"} +} + +run_ld_link_tests $aarch64elftests + +# Relocation Tests +run_dump_test "weak-undefined" +run_dump_test "emit-relocs-257" +run_dump_test "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" +# 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-265" +run_dump_test "emit-relocs-266" +run_dump_test "emit-relocs-267" +run_dump_test "emit-relocs-268" +run_dump_test "emit-relocs-269" +run_dump_test "emit-relocs-270" +run_dump_test "emit-relocs-270-bad" +run_dump_test "emit-relocs-271" +run_dump_test "emit-relocs-272" +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" +# 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" +# 287-298 are not done yet +run_dump_test "emit-relocs-299" +# 300-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" +# 310 not done yet +run_dump_test "emit-relocs-311" +run_dump_test "emit-relocs-312" + + +run_dump_test "limit-b" +run_dump_test "limit-bl" +run_dump_test "farcall-section" +run_dump_test "farcall-back" +run_dump_test "farcall-bl" +run_dump_test "farcall-b" +run_dump_test "farcall-b-none-function" +run_dump_test "farcall-bl-none-function" + +run_dump_test "tls-relax-all" +run_dump_test "tls-relax-gd-le" +run_dump_test "tls-relax-gdesc-le" +run_dump_test "tls-relax-gd-ie" +run_dump_test "tls-relax-gdesc-ie" +run_dump_test "tls-relax-ie-le" +run_dump_test "tls-desc-ie" +run_dump_test "tls-relax-gdesc-ie-2" +run_dump_test "tls-relax-gdesc-le-2" +run_dump_test "tls-relax-ie-le-2" +run_dump_test "tls-relax-ie-le-3" +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" + +# ifunc tests +run_dump_test "ifunc-1" +run_dump_test "ifunc-1-local" +run_dump_test "ifunc-2" +run_dump_test "ifunc-2-local" +run_dump_test "ifunc-3a" +run_dump_test "ifunc-3b" +run_dump_test "ifunc-4" +run_dump_test "ifunc-4a" +run_dump_test "ifunc-5a" +run_dump_test "ifunc-5b" +run_dump_test "ifunc-5a-local" +run_dump_test "ifunc-5b-local" +run_dump_test "ifunc-5r-local" +run_dump_test "ifunc-6a" +run_dump_test "ifunc-6b" +run_dump_test "ifunc-7a" +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 "ifunc-14a" +run_dump_test "ifunc-14b" +run_dump_test "ifunc-14c" +run_dump_test "ifunc-14d" +run_dump_test "ifunc-14e" +run_dump_test "ifunc-14f" +run_dump_test "ifunc-15" +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" diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/aarch64.ld b/binutils-2.24/ld/testsuite/ld-aarch64/aarch64.ld new file mode 100644 index 0000000..75ee3b5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/aarch64.ld @@ -0,0 +1,19 @@ +/* Script for ld testsuite */ +OUTPUT_ARCH(aarch64) +ENTRY(_start) +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + PROVIDE (__executable_start = 0x8000); . = 0x8000; + .text : + { + *(.before) + *(.text) + *(.after) + } =0 + . = 0x9000; + .got : { *(.got) *(.got.plt)} + . = 0x12340000; + .far : { *(.far) } + .ARM.attributes 0 : { *(.ARM.atttributes) } +} diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/eh-frame-bar.s b/binutils-2.24/ld/testsuite/ld-aarch64/eh-frame-bar.s new file mode 100644 index 0000000..a67d8e4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/eh-frame-bar.s @@ -0,0 +1,38 @@ +__longjmp: + .cfi_startproc + .cfi_def_cfa x0, 0 + .cfi_offset x19, 16 + .cfi_offset x20, 16 + .cfi_offset x21, 16 + .cfi_offset x22, 16 + .cfi_offset x23, 24 + .cfi_offset x24, 24 + .cfi_offset x25, 24 + .cfi_offset x26, 24 + .cfi_offset x27, 24 + .cfi_offset x28, 32 + .cfi_offset x29, 32 + .cfi_offset x30, 36 + .cfi_offset d9, 8 +# This eh frame data differs from eh-frame-bar.s here, see the comment +# in eh-frame-foo.s + .cfi_offset d11, 8 + + ldp x19, x20, [x0, #16] + ldp x21, x22, [x0, #16] + ldp x23, x24, [x0, #24] + ldp x25, x26, [x0, #24] + ldp x27, x28, [x0, #24] + ldp x29, x30, [x0, #32] + + ldp d8, d9, [x0, #8] + ldp d10, d11, [x0, #8] + ldp d12, d13, [x0, #8] + ldp d14, d15, [x0, #8] + ldr x5, [x0, #48] + mov sp, x5 + cmp x1, #0 + mov x0, #1 + csel x0, x1, x0, ne + br x30 + .cfi_endproc diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/eh-frame-foo.s b/binutils-2.24/ld/testsuite/ld-aarch64/eh-frame-foo.s new file mode 100644 index 0000000..c077ef2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/eh-frame-foo.s @@ -0,0 +1,55 @@ +__longjmp: + .cfi_startproc + .cfi_def_cfa x0, 0 + .cfi_offset x19, 16 + .cfi_offset x20, 16 + .cfi_offset x21, 16 + .cfi_offset x22, 16 + .cfi_offset x23, 24 + .cfi_offset x24, 24 + .cfi_offset x25, 24 + .cfi_offset x26, 24 + .cfi_offset x27, 24 + .cfi_offset x28, 32 + .cfi_offset x29, 32 + .cfi_offset x30, 36 + .cfi_offset d9, 8 + +/* This eh frame data differs from eh-frame-bar.s here. The eh + frame information is identical but changes at the end. The + initial identical section is long enough to overflow the + initial instruction buffer used in eh frame merging. This + checks that merging does something sane once the initial + instruction buffer overflows. */ + +.cfi_offset d10, 8 + + + + + + + + ldp x19, x20, [x0, #16] + ldp x21, x22, [x0, #16] + ldp x23, x24, [x0, #24] + ldp x25, x26, [x0, #24] + ldp x27, x28, [x0, #24] + ldp x29, x30, [x0, #32] + + ldp d8, d9, [x0, #8] + ldp d10, d11, [x0, #8] + ldp d12, d13, [x0, #8] + ldp d14, d15, [x0, #8] + ldr x5, [x0, #48] + mov sp, x5 + cmp x1, #0 + mov x0, #1 + csel x0, x1, x0, ne + + br x30 + .cfi_endproc + + .global _start +_start: + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/eh-frame.d b/binutils-2.24/ld/testsuite/ld-aarch64/eh-frame.d new file mode 100644 index 0000000..f3daeb2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/eh-frame.d @@ -0,0 +1,86 @@ +.*: file format elf64-(little|big)aarch64 + +Contents of the .eh_frame section: + +0+0000 0+0044 0+0000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 2 + Data alignment factor: -4 + Return address column: 30 + Augmentation data: 1b + + DW_CFA_def_cfa: r31 ofs 0 + DW_CFA_def_cfa: r0 ofs 0 + DW_CFA_offset_extended_sf: r19 at cfa\+16 + DW_CFA_offset_extended_sf: r20 at cfa\+16 + DW_CFA_offset_extended_sf: r21 at cfa\+16 + DW_CFA_offset_extended_sf: r22 at cfa\+16 + DW_CFA_offset_extended_sf: r23 at cfa\+24 + DW_CFA_offset_extended_sf: r24 at cfa\+24 + DW_CFA_offset_extended_sf: r25 at cfa\+24 + DW_CFA_offset_extended_sf: r26 at cfa\+24 + DW_CFA_offset_extended_sf: r27 at cfa\+24 + DW_CFA_offset_extended_sf: r28 at cfa\+32 + DW_CFA_offset_extended_sf: r29 at cfa\+32 + DW_CFA_offset_extended_sf: r30 at cfa\+36 + DW_CFA_offset_extended_sf: r9 at cfa\+8 + DW_CFA_offset_extended_sf: r11 at cfa\+8 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + +0+0048 0+0014 0+004c FDE cie=0+0000 pc=f+fffff80..f+fffffc0 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + +0+0060 0+0044 0+0000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 2 + Data alignment factor: -4 + Return address column: 30 + Augmentation data: 1b + + DW_CFA_def_cfa: r31 ofs 0 + DW_CFA_def_cfa: r0 ofs 0 + DW_CFA_offset_extended_sf: r19 at cfa\+16 + DW_CFA_offset_extended_sf: r20 at cfa\+16 + DW_CFA_offset_extended_sf: r21 at cfa\+16 + DW_CFA_offset_extended_sf: r22 at cfa\+16 + DW_CFA_offset_extended_sf: r23 at cfa\+24 + DW_CFA_offset_extended_sf: r24 at cfa\+24 + DW_CFA_offset_extended_sf: r25 at cfa\+24 + DW_CFA_offset_extended_sf: r26 at cfa\+24 + DW_CFA_offset_extended_sf: r27 at cfa\+24 + DW_CFA_offset_extended_sf: r28 at cfa\+32 + DW_CFA_offset_extended_sf: r29 at cfa\+32 + DW_CFA_offset_extended_sf: r30 at cfa\+36 + DW_CFA_offset_extended_sf: r9 at cfa\+8 + DW_CFA_offset_extended_sf: r10 at cfa\+8 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + +0+00a8 0+0014 0+004c FDE cie=0+0060 pc=f+fffffc0..0+0000 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-257-be.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-257-be.d new file mode 100644 index 0000000..3f6be24 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-257-be.d @@ -0,0 +1,16 @@ +#source: emit-relocs-257.s +#ld: -T relocs.ld --defsym tempy=0x11012 --defsym tempy2=0x45034 --defsym tempy3=0x1234 -e0 --emit-relocs +#notarget: aarch64-*-* +#objdump: -dr +#... + +10000: 00011012 \.word 0x00011012 + +10000: R_AARCH64_ABS32 tempy + +10004: 00000000 \.word 0x00000000 + +10004: R_AARCH64_ABS64 tempy2 + +10008: 00045034 \.word 0x00045034 + +1000c: 1234123c \.word 0x1234123c + +1000c: R_AARCH64_ABS16 tempy3 + +1000e: R_AARCH64_ABS16 tempy3\+0x8 + +10010: 8a000000 and x0, x0, x0 + +10014: 92400000 and x0, x0, #0x1 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-257.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-257.d new file mode 100644 index 0000000..0a3a7ac --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-257.d @@ -0,0 +1,16 @@ +#source: emit-relocs-257.s +#ld: -T relocs.ld --defsym tempy=0x11012 --defsym tempy2=0x45034 --defsym tempy3=0x1234 -e0 --emit-relocs +#notarget: aarch64_be-*-* +#objdump: -dr +#... + +10000: 00011012 \.word 0x00011012 + +10000: R_AARCH64_ABS32 tempy + +10004: 00045034 \.word 0x00045034 + +10004: R_AARCH64_ABS64 tempy2 + +10008: 00000000 \.word 0x00000000 + +1000c: 123c1234 \.word 0x123c1234 + +1000c: R_AARCH64_ABS16 tempy3 + +1000e: R_AARCH64_ABS16 tempy3\+0x8 + +10010: 8a000000 and x0, x0, x0 + +10014: 92400000 and x0, x0, #0x1 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-257.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-257.s new file mode 100644 index 0000000..609ebba --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-257.s @@ -0,0 +1,12 @@ +.comm gempy,4,4 +.text + +.word tempy +.xword tempy2 +.hword tempy3 +.hword tempy3+8 + + and x0,x0,x0 + and x0,x0,#0x1 + + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-260-be.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-260-be.d new file mode 100644 index 0000000..7cea3c6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-260-be.d @@ -0,0 +1,14 @@ +#source: emit-relocs-260.s +#ld: -T relocs.ld --defsym tempy=0x11012 --defsym tempy2=0x45034 --defsym tempy3=0x1234 --defsym _GOT_=0x10000 -e0 --emit-relocs +#notarget: aarch64-*-* +#objdump: -dr +#... + +10000: R_AARCH64_PREL32 _GOT_ + +10004: R_AARCH64_PREL64 _GOT_\+0x12 + +10008: 0000000e \.word 0x0000000e + +1000c: fff404f2 \.word 0xfff404f2 + +1000c: R_AARCH64_PREL16 _GOT_ + +1000e: R_AARCH64_PREL16 _GOT_\+0x500 + +10010: 8a000000 and x0, x0, x0 + +10014: 92400000 and x0, x0, #0x1 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-260.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-260.d new file mode 100644 index 0000000..91c1d8a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-260.d @@ -0,0 +1,16 @@ +#source: emit-relocs-260.s +#ld: -T relocs.ld --defsym tempy=0x11012 --defsym tempy2=0x45034 --defsym tempy3=0x1234 --defsym _GOT_=0x10000 -e0 --emit-relocs +#notarget: aarch64_be-*-* +#objdump: -dr +#... + +10000: 00000000 \.word 0x00000000 + +10000: R_AARCH64_PREL32 _GOT_ + +10004: 0000000e \.word 0x0000000e + +10004: R_AARCH64_PREL64 _GOT_\+0x12 + +10008: 00000000 \.word 0x00000000 + +1000c: 04f2fff4 \.word 0x04f2fff4 + +1000c: R_AARCH64_PREL16 _GOT_ + +1000e: R_AARCH64_PREL16 _GOT_\+0x500 + +10010: 8a000000 and x0, x0, x0 + +10014: 92400000 and x0, x0, #0x1 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-260.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-260.s new file mode 100644 index 0000000..87aa342 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-260.s @@ -0,0 +1,13 @@ +.comm gempy,4,4 +.text + +.word _GOT_ - . +.xword _GOT_ - . + 0x12 +.hword _GOT_ - . +.hword _GOT_ - . + 0x500 + + and x0,x0,x0 + and x0,x0,#0x1 + + + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-262.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-262.d new file mode 100644 index 0000000..c42ecb6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-262.d @@ -0,0 +1,16 @@ +#source: emit-relocs-262.s +#ld: -T relocs.ld --defsym tempy=0x11012 --defsym tempy2=0x45034 --defsym tempy3=0x1234 --defsym _GOT_=0x20000 -e0 --emit-relocs +#error: .*truncated.* +#objdump: -dr +#... + +10000: 00011012 \.word 0x00011012 + +10000: R_AARCH64_PREL32 tempy + +10004: 00045034 \.word 0x00045034 + +10004: R_AARCH64_PREL64 tempy2 + +10008: 00000000 \.word 0x00000000 + +1000c: 123c1234 \.word 0x123c1234 + +1000c: R_AARCH64_PREL16 tempy3 + +1000e: R_AARCH64_PREL16 tempy3\+0x8 + +10010: 8a000000 and x0, x0, x0 + +10014: 92400000 and x0, x0, #0x1 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-262.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-262.s new file mode 100644 index 0000000..aa97f52 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-262.s @@ -0,0 +1,13 @@ +.comm gempy,4,4 +.text + +.word _GOT_ - . +.xword _GOT_ - . + 0x12 +.hword _GOT_ - . +.hword _GOT_ - . + + and x0,x0,x0 + and x0,x0,#0x1 + + + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-263.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-263.d new file mode 100644 index 0000000..a6c854d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-263.d @@ -0,0 +1,15 @@ +#source: emit-relocs-263.s +#ld: -T relocs.ld --defsym tempy=0x11000 --defsym tempy2=0x45000 --defsym tempy3=0x1234 -e0 --emit-relocs +#error: .*\(.text\+0x\d+\): relocation truncated to fit: R_AARCH64_MOVW_UABS_G0 against symbol `tempy.* +#objdump: -dr + +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: d2820004 movz x4, #0x1000 + +10008: R_AARCH64_MOVW_UABS_G0 tempy + +1000c: d28a0007 movz x7, #0x5000 + +1000c: R_AARCH64_MOVW_UABS_G0 tempy2 + +10010: d2824691 movz x17, #0x1234 + +10010: R_AARCH64_MOVW_UABS_G0 tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-263.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-263.s new file mode 100644 index 0000000..e215872 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-263.s @@ -0,0 +1,9 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + movz x4, :abs_g0:tempy + movz x7, :abs_g0:tempy2 + movz x17, :abs_g0:tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-264.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-264.d new file mode 100644 index 0000000..eb93154 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-264.d @@ -0,0 +1,13 @@ +#source: emit-relocs-264.s +#ld: -T relocs.ld --defsym tempy=0x11000 --defsym tempy2=0x45000 --defsym tempy3=0x1234 -e0 --emit-relocs +#objdump: -dr -Mno-aliases +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: d2820004 movz x4, #0x1000 + +10008: R_AARCH64_MOVW_UABS_G0_NC tempy + +1000c: d28a0007 movz x7, #0x5000 + +1000c: R_AARCH64_MOVW_UABS_G0_NC tempy2 + +10010: d2824691 movz x17, #0x1234 + +10010: R_AARCH64_MOVW_UABS_G0_NC tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-264.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-264.s new file mode 100644 index 0000000..32a5a17 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-264.s @@ -0,0 +1,9 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + movz x4, :abs_g0_nc:tempy + movz x7, :abs_g0_nc:tempy2 + movz x17, :abs_g0_nc:tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-265.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-265.d new file mode 100644 index 0000000..d30db5f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-265.d @@ -0,0 +1,14 @@ +#source: emit-relocs-265.s +#ld: -T relocs.ld --defsym tempy=0x100011000 --defsym tempy2=0x45000 --defsym tempy3=0x1234 -e0 --emit-relocs +#error: .*\(.text\+0x\d+\): relocation truncated to fit: R_AARCH64_MOVW_UABS_G1 against symbol `tempy.* +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: d2a00024 movz x4, #0x1, lsl #16 + +10008: R_AARCH64_MOVW_UABS_G1 tempy + +1000c: d2a00087 movz x7, #0x4, lsl #16 + +1000c: R_AARCH64_MOVW_UABS_G1 tempy2 + +10010: d2a00011 movz x17, #0x0, lsl #16 + +10010: R_AARCH64_MOVW_UABS_G1 tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-265.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-265.s new file mode 100644 index 0000000..552a8ae --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-265.s @@ -0,0 +1,10 @@ +.comm gempy,4,4 +.text + + + and x0,x0,x0 + and x0,x0,#0x1 + movz x4, :abs_g1:tempy + movz x7, :abs_g1:tempy2 + movz x17, :abs_g1:tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-266.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-266.d new file mode 100644 index 0000000..d517c8e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-266.d @@ -0,0 +1,13 @@ +#source: emit-relocs-266.s +#ld: -T relocs.ld --defsym tempy=0x11000 --defsym tempy2=0x45000 --defsym tempy3=0x1234 -e0 --emit-relocs +#objdump: -dr -Mno-aliases +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: d2a00024 movz x4, #0x1, lsl #16 + +10008: R_AARCH64_MOVW_UABS_G1_NC tempy + +1000c: d2a00087 movz x7, #0x4, lsl #16 + +1000c: R_AARCH64_MOVW_UABS_G1_NC tempy2 + +10010: d2a00011 movz x17, #0x0, lsl #16 + +10010: R_AARCH64_MOVW_UABS_G1_NC tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-266.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-266.s new file mode 100644 index 0000000..7c23e87 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-266.s @@ -0,0 +1,10 @@ +.comm gempy,4,4 +.text + + + and x0,x0,x0 + and x0,x0,#0x1 + movz x4, :abs_g1_nc:tempy + movz x7, :abs_g1_nc:tempy2 + movz x17, :abs_g1_nc:tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-267.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-267.d new file mode 100644 index 0000000..9cc495c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-267.d @@ -0,0 +1,14 @@ +#source: emit-relocs-267.s +#ld: -T relocs.ld --defsym tempy=0x63001000 --defsym tempy2=0x4500000000 --defsym tempy3=0x1234567812345 -e0 --emit-relocs +#error: .*truncated.*tempy3.* +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: d2c00004 movz x4, #0x0, lsl #32 + +10008: R_AARCH64_MOVW_UABS_G2 tempy + +1000c: d2c008a7 movz x7, #0x45, lsl #32 + +1000c: R_AARCH64_MOVW_UABS_G2 tempy2 + +10010: d2c468b1 movz x17, #0x2345, lsl #32 + +10010: R_AARCH64_MOVW_UABS_G2 tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-267.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-267.s new file mode 100644 index 0000000..94a150e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-267.s @@ -0,0 +1,9 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + movz x4, :abs_g2:tempy + movz x7, :abs_g2:tempy2 + movz x17, :abs_g2:tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-268.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-268.d new file mode 100644 index 0000000..2733ebf --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-268.d @@ -0,0 +1,13 @@ +#source: emit-relocs-268.s +#ld: -T relocs.ld --defsym tempy=0x63001000 --defsym tempy2=0x4500000000 --defsym tempy3=0x1234567812345 -e0 --emit-relocs +#objdump: -dr -Mno-aliases +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: d2c00004 movz x4, #0x0, lsl #32 + +10008: R_AARCH64_MOVW_UABS_G2_NC tempy + +1000c: d2c008a7 movz x7, #0x45, lsl #32 + +1000c: R_AARCH64_MOVW_UABS_G2_NC tempy2 + +10010: d2c468b1 movz x17, #0x2345, lsl #32 + +10010: R_AARCH64_MOVW_UABS_G2_NC tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-268.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-268.s new file mode 100644 index 0000000..5928043 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-268.s @@ -0,0 +1,9 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + movz x4, :abs_g2_nc:tempy + movz x7, :abs_g2_nc:tempy2 + movz x17, :abs_g2_nc:tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-269.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-269.d new file mode 100644 index 0000000..0ed2729 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-269.d @@ -0,0 +1,13 @@ +#source: emit-relocs-269.s +#ld: -T relocs.ld --defsym tempy=0x6300100100100100 --defsym tempy2=0xf00df00df00df00d --defsym tempy3=0x1234567812345 -e0 --emit-relocs +#objdump: -dr -Mno-aliases +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: d2ec6004 movz x4, #0x6300, lsl #48 + +10008: R_AARCH64_MOVW_UABS_G3 tempy + +1000c: d2fe01a7 movz x7, #0xf00d, lsl #48 + +1000c: R_AARCH64_MOVW_UABS_G3 tempy2 + +10010: d2e00031 movz x17, #0x1, lsl #48 + +10010: R_AARCH64_MOVW_UABS_G3 tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-269.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-269.s new file mode 100644 index 0000000..b0f11a0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-269.s @@ -0,0 +1,9 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + movz x4, :abs_g3:tempy + movz x7, :abs_g3:tempy2 + movz x17, :abs_g3:tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-270-bad.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-270-bad.d new file mode 100644 index 0000000..a781a5a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-270-bad.d @@ -0,0 +1,15 @@ +#source: emit-relocs-270.s +#ld: -T relocs.ld --defsym tempy=0x10012 --defsym tempy2=0x45000 --defsym tempy3=-292 -e0 --emit-relocs +#error: .*truncated.*tempy[12].* +#objdump: -dr + +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: d2820244 movz x4, #0x1012 + +10008: R_AARCH64_MOVW_SABS_G0 tempy + +1000c: d288a007 movz x7, #0x4500 + +1000c: R_AARCH64_MOVW_SABS_G0 tempy2 + +10010: 92802471 movn x17, #0x123 + +10010: R_AARCH64_MOVW_SABS_G0 tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-270.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-270.d new file mode 100644 index 0000000..442150e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-270.d @@ -0,0 +1,14 @@ +#source: emit-relocs-270.s +#ld: -T relocs.ld --defsym tempy=0x1012 --defsym tempy2=0x4500 --defsym tempy3=-292 -e0 --emit-relocs +#objdump: -dr -Mno-aliases + +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: d2820244 movz x4, #0x1012 + +10008: R_AARCH64_MOVW_SABS_G0 tempy + +1000c: d288a007 movz x7, #0x4500 + +1000c: R_AARCH64_MOVW_SABS_G0 tempy2 + +10010: 92802471 movn x17, #0x123 + +10010: R_AARCH64_MOVW_SABS_G0 tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-270.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-270.s new file mode 100644 index 0000000..b508f88 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-270.s @@ -0,0 +1,9 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + movz x4, :abs_g0_s:tempy + movz x7, :abs_g0_s:tempy2 + movz x17, :abs_g0_s:tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-271.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-271.d new file mode 100644 index 0000000..1f34820 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-271.d @@ -0,0 +1,14 @@ +#source: emit-relocs-271.s +#ld: -T relocs.ld --defsym tempy=0x1012 --defsym tempy2=0x674500 --defsym tempy3=-292 -e0 --emit-relocs +#objdump: -dr -Mno-aliases + +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: d2a00004 movz x4, #0x0, lsl #16 + +10008: R_AARCH64_MOVW_SABS_G1 tempy + +1000c: d2a00ce7 movz x7, #0x67, lsl #16 + +1000c: R_AARCH64_MOVW_SABS_G1 tempy2 + +10010: 92a00011 movn x17, #0x0, lsl #16 + +10010: R_AARCH64_MOVW_SABS_G1 tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-271.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-271.s new file mode 100644 index 0000000..bb14fbb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-271.s @@ -0,0 +1,9 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + movz x4, :abs_g1_s:tempy + movz x7, :abs_g1_s:tempy2 + movz x17, :abs_g1_s:tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-272.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-272.d new file mode 100644 index 0000000..011ead5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-272.d @@ -0,0 +1,14 @@ +#source: emit-relocs-272.s +#ld: -T relocs.ld --defsym tempy=0x1012 --defsym tempy2=-12345678912345 --defsym tempy3=-292 -e0 --emit-relocs +#objdump: -dr -Mno-aliases + +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: d2c00004 movz x4, #0x0, lsl #32 + +10008: R_AARCH64_MOVW_SABS_G2 tempy + +1000c: 92c16747 movn x7, #0xb3a, lsl #32 + +1000c: R_AARCH64_MOVW_SABS_G2 tempy2 + +10010: 92c00011 movn x17, #0x0, lsl #32 + +10010: R_AARCH64_MOVW_SABS_G2 tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-272.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-272.s new file mode 100644 index 0000000..daa625a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-272.s @@ -0,0 +1,9 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + movz x4, :abs_g2_s:tempy + movz x7, :abs_g2_s:tempy2 + movz x17, :abs_g2_s:tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-273.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-273.d new file mode 100644 index 0000000..13ed221 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-273.d @@ -0,0 +1,13 @@ +#source: emit-relocs-273.s +#ld: -T relocs.ld --defsym tempy=0x11000 --defsym tempy2=0x45000 --defsym tempy3=0x1234 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: 58007fc4 ldr x4, 11000 <tempy> + +10008: R_AARCH64_LD_PREL_LO19 tempy + +1000c: 581a7fa7 ldr x7, 45000 <tempy2> + +1000c: R_AARCH64_LD_PREL_LO19 tempy2 + +10010: 58f89131 ldr x17, 1234 <tempy3> + +10010: R_AARCH64_LD_PREL_LO19 tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-273.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-273.s new file mode 100644 index 0000000..d1bad37 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-273.s @@ -0,0 +1,9 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + ldr x4,tempy + ldr x7,tempy2 + ldr x17,tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-274.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-274.d new file mode 100644 index 0000000..f38ecbd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-274.d @@ -0,0 +1,12 @@ +#source: emit-relocs-274.s +#ld: -T relocs.ld --defsym tempy=0x11000 --defsym tempy2=0x45000 --defsym tempy3=0x1234 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: 10007fc2 adr x2, .* + +10008: R_AARCH64_ADR_PREL_LO21 tempy + +1000c: 101a7fa7 adr x7, 45000 .* + +1000c: R_AARCH64_ADR_PREL_LO21 tempy2 + +10010: 10f89131 adr x17, .* + +10010: R_AARCH64_ADR_PREL_LO21 tempy3 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-274.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-274.s new file mode 100644 index 0000000..8668b7c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-274.s @@ -0,0 +1,5 @@ + and x0,x0,x0 + and x0,x0,#1 + adr x2,tempy + adr x7,tempy2 + adr x17,tempy3 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-275.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-275.d new file mode 100644 index 0000000..94e61a7 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-275.d @@ -0,0 +1,15 @@ +#source: emit-relocs-275.s +#ld: -T relocs.ld --defsym tempy=0x200011000 --defsym tempy2=0x45000 --defsym tempy3=0x1234 -e0 --emit-relocs +#error: .*\(.text\+0x\d+\): relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against symbol `tempy' +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: b0000002 adrp x2, .* + +10008: R_AARCH64_ADR_PREL_PG_HI21 tempy + +1000c: b00001a7 adrp x7, .* + +1000c: R_AARCH64_ADR_PREL_PG_HI21 tempy2 + +10010: b0ffff91 adrp x17, .* + +10010: R_AARCH64_ADR_PREL_PG_HI21 tempy3 + + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-275.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-275.s new file mode 100644 index 0000000..92a2935 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-275.s @@ -0,0 +1,8 @@ +.comm gempy,4,4 +.text + and x0,x0,x0 + and x0,x0,#1 + adrp x2,tempy + adrp x7,tempy2 + adrp x17,tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-276.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-276.d new file mode 100644 index 0000000..f133253 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-276.d @@ -0,0 +1,14 @@ +#source: emit-relocs-275.s +#ld: -T relocs.ld --defsym tempy=0x11000 --defsym tempy2=0x45000 --defsym tempy3=0x1234 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: b0000002 adrp x2, 11000 <tempy> + +10008: R_AARCH64_ADR_PREL_PG_HI21 tempy + +1000c: b00001a7 adrp x7, 45000 <tempy2> + +1000c: R_AARCH64_ADR_PREL_PG_HI21 tempy2 + +10010: b0ffff91 adrp x17, 1000 <tempy3-0x234> + +10010: R_AARCH64_ADR_PREL_PG_HI21 tempy3 + + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-276.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-276.s new file mode 100644 index 0000000..92a2935 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-276.s @@ -0,0 +1,8 @@ +.comm gempy,4,4 +.text + and x0,x0,x0 + and x0,x0,#1 + adrp x2,tempy + adrp x7,tempy2 + adrp x17,tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-277.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-277.d new file mode 100644 index 0000000..2145441 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-277.d @@ -0,0 +1,13 @@ +#source: emit-relocs-277.s +#ld: -T relocs.ld --defsym tempy=0x11018 --defsym tempy2=0x45038 --defsym tempy3=0x1234 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: 91006064 add x4, x3,.* + +10008: R_AARCH64_ADD_ABS_LO12_NC tempy + +1000c: 9100e067 add x7, x3,.* + +1000c: R_AARCH64_ADD_ABS_LO12_NC tempy2 + +10010: 9108d071 add x17, x3,.* + +10010: R_AARCH64_ADD_ABS_LO12_NC tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-277.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-277.s new file mode 100644 index 0000000..efb0bf0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-277.s @@ -0,0 +1,8 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + add x4, x3, #:lo12:tempy + add x7, x3, #:lo12:tempy2 + add x17, x3, #:lo12:tempy3 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-278.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-278.d new file mode 100644 index 0000000..29a0095 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-278.d @@ -0,0 +1,13 @@ +#source: emit-relocs-278.s +#ld: -T relocs.ld --defsym tempy=0x11018 --defsym tempy2=0x45038 --defsym tempy3=0x1234 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: 3d406064 ldr b4, \[x3,.* + +10008: R_AARCH64_LDST8_ABS_LO12_NC tempy + +1000c: 3d40e067 ldr b7, \[x3,.* + +1000c: R_AARCH64_LDST8_ABS_LO12_NC tempy2 + +10010: 3d48d071 ldr b17, \[x3,.* + +10010: R_AARCH64_LDST8_ABS_LO12_NC tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-278.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-278.s new file mode 100644 index 0000000..2f7f321 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-278.s @@ -0,0 +1,8 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + ldr b4, [x3, #:lo12:tempy] + ldr b7, [x3, #:lo12:tempy2] + ldr b17, [x3, #:lo12:tempy3] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-279-bad.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-279-bad.d new file mode 100644 index 0000000..02b5ff6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-279-bad.d @@ -0,0 +1,13 @@ +#source: emit-relocs-279.s +#ld: -T relocs.ld --defsym target=0xc000 --defsym target2=0x45678 -e0 --emit-relocs +#error: .*truncated.*target2.* +#objdump: -dr +#... + +10000: 8a000000 and .* + +10004: 8a000000 and .* + +10008: 8a000000 and .* + +1000c: 8a000000 and .* + +10010: 17ffeffc b c000 <target> + +10010: R_AARCH64_TSTBR14 target + +10014: 17ffefff b c010 <target\+0x10> + +10014: R_AARCH64_TSTBR14 target\+0x10 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-279.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-279.d new file mode 100644 index 0000000..6980f81 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-279.d @@ -0,0 +1,17 @@ +#source: emit-relocs-279.s +#ld: -T relocs.ld --defsym target=0xc000 --defsym target2=0x12340 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and .* + +10004: 8a000000 and .* + +10008: 8a000000 and .* + +1000c: 8a000000 and .* + +10010: 363dff84 tbz w4, #7, c000 <target> + +10010: R_AARCH64_TSTBR14 target + +10014: b745ffe7 tbnz x7, #40, c010 <target\+0x10> + +10014: R_AARCH64_TSTBR14 target\+0x10 + +10018: 3619194c tbz w12, #3, 12340 <target2> + +10018: R_AARCH64_TSTBR14 target2 + +1001c: b7c118d1 tbnz x17, #56, 12334 <target.* + +1001c: R_AARCH64_TSTBR14 target.* + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-279.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-279.s new file mode 100644 index 0000000..f70c78b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-279.s @@ -0,0 +1,8 @@ + and x0,x0,x0 + and x0,x0,x0 + and x0,x0,x0 + and x0,x0,x0 + tbz x4, 7, target + tbnz x7, 40, target+16 + tbz x12, 3, target2 + tbnz x17, 56, target2-12 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-280.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-280.d new file mode 100644 index 0000000..9b954ff --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-280.d @@ -0,0 +1,12 @@ +#source: emit-relocs-280.s +#ld: -T relocs.ld --defsym target=0xc000 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and .* + +10004: 8a000000 and .* + +10008: 8a000000 and .* + +1000c: 8a000000 and .* + +10010: 54fdff80 b.eq c000 <target> + +10010: R_AARCH64_CONDBR19 target + +10014: 54fdffe0 b.eq c010 <target\+0x10> + +10014: R_AARCH64_CONDBR19 target\+0x10 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-280.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-280.s new file mode 100644 index 0000000..8f5ec34 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-280.s @@ -0,0 +1,6 @@ + and x0,x0,x0 + and x0,x0,x0 + and x0,x0,x0 + and x0,x0,x0 + beq target + beq target+16 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-282.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-282.d new file mode 100644 index 0000000..fc5764b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-282.d @@ -0,0 +1,12 @@ +#source: emit-relocs-282.s +#ld: -T relocs.ld --defsym target=0xc000 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and .* + +10004: 8a000000 and .* + +10008: 8a000000 and .* + +1000c: 8a000000 and .* + +10010: 17ffeffc b c000 <target> + +10010: R_AARCH64_JUMP26 target + +10014: 17ffefff b c010 <target\+0x10> + +10014: R_AARCH64_JUMP26 target\+0x10 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-282.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-282.s new file mode 100644 index 0000000..b249b6b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-282.s @@ -0,0 +1,6 @@ + and x0,x0,x0 + and x0,x0,x0 + and x0,x0,x0 + and x0,x0,x0 + b target + b target+16 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-283.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-283.d new file mode 100644 index 0000000..708fc7c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-283.d @@ -0,0 +1,12 @@ +#source: emit-relocs-283.s +#ld: -T relocs.ld --defsym target=0xc000 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and .* + +10004: 8a000000 and .* + +10008: 8a000000 and .* + +1000c: 8a000000 and .* + +10010: 97ffeffc bl c000 <target> + +10010: R_AARCH64_CALL26 target + +10014: 97ffefff bl c010 <target\+0x10> + +10014: R_AARCH64_CALL26 target\+0x10 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-283.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-283.s new file mode 100644 index 0000000..9c9f509 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-283.s @@ -0,0 +1,6 @@ + and x0,x0,x0 + and x0,x0,x0 + and x0,x0,x0 + and x0,x0,x0 + bl target + bl target+16 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-284.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-284.d new file mode 100644 index 0000000..5cb6dac --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-284.d @@ -0,0 +1,13 @@ +#source: emit-relocs-284.s +#ld: -T relocs.ld --defsym tempy=0x11018 --defsym tempy2=0x45038 --defsym tempy3=0x1234 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: 7d403064 ldr h4, \[x3,.* + +10008: R_AARCH64_LDST16_ABS_LO12_NC tempy + +1000c: 7d407067 ldr h7, \[x3,.* + +1000c: R_AARCH64_LDST16_ABS_LO12_NC tempy2 + +10010: 7d446871 ldr h17, \[x3,.* + +10010: R_AARCH64_LDST16_ABS_LO12_NC tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-284.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-284.s new file mode 100644 index 0000000..ffd213b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-284.s @@ -0,0 +1,8 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + ldr h4, [x3, #:lo12:tempy] + ldr h7, [x3, #:lo12:tempy2] + ldr h17, [x3, #:lo12:tempy3] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-285.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-285.d new file mode 100644 index 0000000..8bf8270 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-285.d @@ -0,0 +1,13 @@ +#source: emit-relocs-285.s +#ld: -T relocs.ld --defsym tempy=0x11018 --defsym tempy2=0x45038 --defsym tempy3=0x1234 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: b9401864 ldr w4, \[x3,.* + +10008: R_AARCH64_LDST32_ABS_LO12_NC tempy + +1000c: b9403867 ldr w7, \[x3,.* + +1000c: R_AARCH64_LDST32_ABS_LO12_NC tempy2 + +10010: b9423471 ldr w17, \[x3,.* + +10010: R_AARCH64_LDST32_ABS_LO12_NC tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-285.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-285.s new file mode 100644 index 0000000..245f8be --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-285.s @@ -0,0 +1,8 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + ldr w4, [x3, #:lo12:tempy] + ldr w7, [x3, #:lo12:tempy2] + ldr w17, [x3, #:lo12:tempy3] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-286-bad.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-286-bad.d new file mode 100644 index 0000000..50cd605 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-286-bad.d @@ -0,0 +1,14 @@ +#source: emit-relocs-286.s +#ld: -T relocs.ld --defsym tempy=0x11018 --defsym tempy2=0x45038 --defsym tempy3=0x1234 -e0 --emit-relocs +#error: .*truncated.*tempy3.* +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: f9400c64 ldr x4, \[x3,.* + +10008: R_AARCH64_LDST64_ABS_LO12_NC tempy + +1000c: f9401c67 ldr x7, \[x3,.* + +1000c: R_AARCH64_LDST64_ABS_LO12_NC tempy2 + +10010: f9411871 ldr x17, \[x3,.* + +10010: R_AARCH64_LDST64_ABS_LO12_NC tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-286.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-286.d new file mode 100644 index 0000000..851fa7b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-286.d @@ -0,0 +1,13 @@ +#source: emit-relocs-286.s +#ld: -T relocs.ld --defsym tempy=0x11018 --defsym tempy2=0x45038 --defsym tempy3=0x1230 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: f9400c64 ldr x4, \[x3,.* + +10008: R_AARCH64_LDST64_ABS_LO12_NC tempy + +1000c: f9401c67 ldr x7, \[x3,.* + +1000c: R_AARCH64_LDST64_ABS_LO12_NC tempy2 + +10010: f9411871 ldr x17, \[x3,.* + +10010: R_AARCH64_LDST64_ABS_LO12_NC tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-286.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-286.s new file mode 100644 index 0000000..78b508f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-286.s @@ -0,0 +1,8 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + ldr x4, [x3, #:lo12:tempy] + ldr x7, [x3, #:lo12:tempy2] + ldr x17, [x3, #:lo12:tempy3] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-287.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-287.d new file mode 100644 index 0000000..4d5fd43 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-287.d @@ -0,0 +1,14 @@ +#source: emit-relocs-287.s +#ld: -T relocs.ld --defsym tempy=0x11000 --defsym tempy2=0x45000 --defsym tempy3=0x1234 --defsym _GOT_=0x10000 -e0 --emit-relocs +#objdump: -dr + +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: d2820004 movz x4, #0x1000 + +10008: R_AARCH64_MOVW_PREL_G0 _GOT_ + +1000c: d28a0007 movz x7, #0x5000 + +1000c: R_AARCH64_MOVW_PREL_G0 _GOT_ + +10010: d2824691 movz x17, #0x1234 + +10010: R_AARCH64_MOVW_PREL_G0 _GOT_ + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-287.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-287.s new file mode 100644 index 0000000..ae9476f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-287.s @@ -0,0 +1,9 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + movz x4, :prel_g0:tempy + movz x7, :prel_g0:tempy2 + movz x17, :prel_g0:tempy3 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-299.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-299.d new file mode 100644 index 0000000..d24b442 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-299.d @@ -0,0 +1,12 @@ +#source: emit-relocs-299.s +#ld: -T relocs.ld --defsym tempy=0x11030 --defsym tempy2=0x45fa0 --defsym tempy3=0x1230 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: 3dc00c64 ldr q4, \[x3,.* + +10008: R_AARCH64_LDST128_ABS_LO12_NC tempy + +1000c: 3dc3e867 ldr q7, \[x3,.* + +1000c: R_AARCH64_LDST128_ABS_LO12_NC tempy2 + +10010: 3dc08c71 ldr q17, \[x3,.* + +10010: R_AARCH64_LDST128_ABS_LO12_NC tempy3 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-299.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-299.s new file mode 100644 index 0000000..b1fe6cf --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-299.s @@ -0,0 +1,8 @@ +.comm gempy,4,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + ldr q4, [x3, #:lo12:tempy] + ldr q7, [x3, #:lo12:tempy2] + ldr q17, [x3, #:lo12:tempy3] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309-low-bad.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309-low-bad.d new file mode 100644 index 0000000..6c2d0dc --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309-low-bad.d @@ -0,0 +1,5 @@ +#name: aarch64-emit-relocs-309-low-bad +#source: emit-relocs-309.s +#as: +#ld: -Ttext 0xFFFFFD --section-start .got=0x0 +#error: .*relocation truncated to fit: R_AARCH64_GOT_LD_PREL19.* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309-low.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309-low.d new file mode 100644 index 0000000..93896cf --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309-low.d @@ -0,0 +1,12 @@ +#name: aarch64-emit-relocs-309-low +#source: emit-relocs-309.s +#as: +#ld: -Ttext 0x100004 --section-start .got=0x0 +#objdump: -dr +#... + +Disassembly of section \.text: + +0000000000100004 <_start>: + 100004: d503201f nop + 100008: 58800000 ldr x0, 8 .* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309-up-bad.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309-up-bad.d new file mode 100644 index 0000000..802b51e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309-up-bad.d @@ -0,0 +1,5 @@ +#name: aarch64-emit-relocs-309-up-bad +#source: emit-relocs-309.s +#as: +#ld: -Ttext 0x0 --section-start .got=0x100001 +#error: .*relocation truncated to fit: R_AARCH64_GOT_LD_PREL19.* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309-up.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309-up.d new file mode 100644 index 0000000..32922ee --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309-up.d @@ -0,0 +1,12 @@ +#name: aarch64-emit-relocs-309-up +#source: emit-relocs-309.s +#as: +#ld: -Ttext 0x0 --section-start .got=0xffff8 +#objdump: -dr +#... + +Disassembly of section \.text: + +0000000000000000 <_start>: + 0: d503201f nop + 4: 587fffe0 ldr x0, 100000 .* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309.s new file mode 100644 index 0000000..edf47cd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-309.s @@ -0,0 +1,14 @@ +# R_AARCH64_GOT_LD_PREL19 must satisfy condition: +# +# -2^20 <= G(S) - P < 2^20 +# + + .comm src,1,8 + + .global _start + + .text + +_start: + nop + ldr x0, :got:src diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-311.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-311.d new file mode 100644 index 0000000..578d6d3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-311.d @@ -0,0 +1,14 @@ +#source: emit-relocs-311.s +#ld: -T relocs.ld --defsym tempy=0x11000 --defsym tempy2=0x45000 --defsym tempy3=0x1234 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: b0000002 adrp x2, 11000 <tempy> + +10008: R_AARCH64_ADR_PREL_PG_HI21 tempy + +1000c: b00001a7 adrp x7, 45000 <tempy2> + +1000c: R_AARCH64_ADR_PREL_PG_HI21 tempy2 + +10010: b0ffff91 adrp x17, 1000 <tempy3-0x234> + +10010: R_AARCH64_ADR_PREL_PG_HI21 tempy3 + +10014: 90000083 adrp x3, 20000 <_GLOBAL_OFFSET_TABLE_> + +10014: R_AARCH64_ADR_GOT_PAGE gempy diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-311.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-311.s new file mode 100644 index 0000000..182f0d4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-311.s @@ -0,0 +1,8 @@ +.comm gempy,4,4 +.text + and x0,x0,x0 + and x0,x0,#1 + adrp x2,tempy + adrp x7,tempy2 + adrp x17,tempy3 + adrp x3,:got:gempy diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-312.d b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-312.d new file mode 100644 index 0000000..c10dc1e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-312.d @@ -0,0 +1,19 @@ +#source: emit-relocs-312.s +#ld: -T relocs.ld --defsym tempy=0x11000 --defsym tempy2=0x45000 --defsym tempy3=0x1234 -e0 --emit-relocs +#objdump: -dr +#... + +10000: 8a000000 and x0, x0, x0 + +10004: 92400000 and x0, x0, #0x1 + +10008: 58007fc4 ldr x4, 11000 <tempy> + +10008: R_AARCH64_LD_PREL_LO19 tempy + +1000c: 581a7fa7 ldr x7, 45000 <tempy2> + +1000c: R_AARCH64_LD_PREL_LO19 tempy2 + +10010: 58f89131 ldr x17, 1234 <tempy3> + +10010: R_AARCH64_LD_PREL_LO19 tempy3 + +10014: f9400c43 ldr x3, \[x2.* + +10014: R_AARCH64_LD64_GOT_LO12_NC jempy + +10018: f9400844 ldr x4, \[x2.* + +10018: R_AARCH64_LD64_GOT_LO12_NC gempy + +1001c: f9400445 ldr x5, \[x2.* + +1001c: R_AARCH64_LD64_GOT_LO12_NC lempy + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-312.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-312.s new file mode 100644 index 0000000..29494ee --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs-312.s @@ -0,0 +1,13 @@ +.comm gempy,4 +.comm jempy,4 +.comm lempy,4 +.text + + and x0,x0,x0 + and x0,x0,#0x1 + ldr x4,tempy + ldr x7,tempy2 + ldr x17,tempy3 + ldr x3, [x2, #:got_lo12:jempy] + ldr x4, [x2, #:got_lo12:gempy] + ldr x5, [x2, #:got_lo12:lempy] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs1.s b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs1.s new file mode 100644 index 0000000..b249b6b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/emit-relocs1.s @@ -0,0 +1,6 @@ + and x0,x0,x0 + and x0,x0,x0 + and x0,x0,x0 + and x0,x0,x0 + b target + b target+16 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/farcall-b-none-function.d b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-b-none-function.d new file mode 100644 index 0000000..34a6568 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-b-none-function.d @@ -0,0 +1,5 @@ +#name: aarch64-farcall-b-none-function +#source: farcall-b-none-function.s +#as: +#ld: -Ttext 0x1000 --section-start .foo=0x8001000 +#error: .*\(.text\+0x0\): relocation truncated to fit: R_AARCH64_JUMP26 against symbol `bar'.* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/farcall-b-none-function.s b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-b-none-function.s new file mode 100644 index 0000000..5e5bc8d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-b-none-function.s @@ -0,0 +1,16 @@ + .global _start + .global bar + +# We will place the section .text at 0x1000. + + .text + +_start: + b bar + ret + +# We will place the section .foo at 0x8001000. + + .section .foo, "xa" +bar: + ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/farcall-b.d b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-b.d new file mode 100644 index 0000000..f3cb5ef --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-b.d @@ -0,0 +1,22 @@ +#name: aarch64-farcall-b +#source: farcall-b.s +#as: +#ld: -Ttext 0x1000 --section-start .foo=0x8001000 +#objdump: -dr +#... + +Disassembly of section .text: + +0000000000001000 <_start>: + +1000: 14000002 b 1008 <__bar_veneer> + +1004: d65f03c0 ret +0000000000001008 <__bar_veneer>: + 1008: 90040010 adrp x16, 8001000 <bar> + 100c: 91000210 add x16, x16, #0x0 + 1010: d61f0200 br x16 + ... + +Disassembly of section .foo: + +0000000008001000 <bar>: + 8001000: d65f03c0 ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/farcall-b.s b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-b.s new file mode 100644 index 0000000..8ab3103 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-b.s @@ -0,0 +1,17 @@ + .global _start + .global bar + +# We will place the section .text at 0x1000. + + .text + +_start: + b bar + ret + +# We will place the section .foo at 0x8001000. + + .section .foo, "xa" + .type bar, @function +bar: + ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/farcall-back.d b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-back.d new file mode 100644 index 0000000..9ff43b3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-back.d @@ -0,0 +1,72 @@ +#name: aarch64-farcall-back +#source: farcall-back.s +#as: +#ld: -Ttext 0x1000 --section-start .foo=0x100000000 +#notarget: aarch64_be-*-* +#objdump: -dr +#... + +Disassembly of section .text: + +0000000000001000 <_start>: + 1000: 14000412 b 2048 <__bar1_veneer> + 1004: 94000411 bl 2048 <__bar1_veneer> + 1008: 14000406 b 2020 <__bar2_veneer> + 100c: 94000405 bl 2020 <__bar2_veneer> + 1010: 14000408 b 2030 <__bar3_veneer> + 1014: 94000407 bl 2030 <__bar3_veneer> + 1018: d65f03c0 ret + ... + +000000000000201c <_back>: + 201c: d65f03c0 ret + +0000000000002020 <__bar2_veneer>: + 2020: f07ffff0 adrp x16, 100001000 <bar1\+0x1000> + 2024: 91002210 add x16, x16, #0x8 + 2028: d61f0200 br x16 + 202c: 00000000 .inst 0x00000000 ; undefined + +0000000000002030 <__bar3_veneer>: + 2030: 58000090 ldr x16, 2040 <__bar3_veneer\+0x10> + 2034: 10000011 adr x17, 2034 <__bar3_veneer\+0x4> + 2038: 8b110210 add x16, x16, x17 + 203c: d61f0200 br x16 + 2040: ffffffdc .word 0xffffffdc + 2044: 00000000 .word 0x00000000 + +0000000000002048 <__bar1_veneer>: + 2048: d07ffff0 adrp x16, 100000000 <bar1> + 204c: 91000210 add x16, x16, #0x0 + 2050: d61f0200 br x16 + ... + +Disassembly of section .foo: + +0000000100000000 <bar1>: + 100000000: d65f03c0 ret + 100000004: 14000805 b 100002018 <___start_veneer> + ... + +0000000100001008 <bar2>: + 100001008: d65f03c0 ret + 10000100c: 14000403 b 100002018 <___start_veneer> + ... + +0000000100002010 <bar3>: + 100002010: d65f03c0 ret + 100002014: 14000007 b 100002030 <___back_veneer> + +0000000100002018 <___start_veneer>: + 100002018: 58000090 ldr x16, 100002028 <___start_veneer\+0x10> + 10000201c: 10000011 adr x17, 10000201c <___start_veneer\+0x4> + 100002020: 8b110210 add x16, x16, x17 + 100002024: d61f0200 br x16 + 100002028: ffffefe4 .word 0xffffefe4 + 10000202c: fffffffe .word 0xfffffffe + +0000000100002030 <___back_veneer>: + 100002030: 90800010 adrp x16, 2000 <_start\+0x1000> + 100002034: 91007210 add x16, x16, #0x1c + 100002038: d61f0200 br x16 + ... diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/farcall-back.s b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-back.s new file mode 100644 index 0000000..d0a3bd5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-back.s @@ -0,0 +1,42 @@ + .global _start + .global _back + .global bar1 + .global bar2 + .global bar3 + +# We will place the section .text at 0x1000. + + .text + + .type _start, @function +_start: + b bar1 + bl bar1 + b bar2 + bl bar2 + b bar3 + bl bar3 + ret + .space 0x1000 + .type _back, @function +_back: ret + +# We will place the section .foo at 0x8001000. + + .section .foo, "xa" + .type bar1, @function +bar1: + ret + b _start + + .space 0x1000 + .type bar2, @function +bar2: + ret + b _start + + .space 0x1000 + .type bar3, @function +bar3: + ret + b _back diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/farcall-bl-none-function.d b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-bl-none-function.d new file mode 100644 index 0000000..6ce9ca4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-bl-none-function.d @@ -0,0 +1,5 @@ +#name: aarch64-farcall-bl-none-function +#source: farcall-bl-none-function.s +#as: +#ld: -Ttext 0x1000 --section-start .foo=0x8001000 +#error: .*\(.text\+0x0\): relocation truncated to fit: R_AARCH64_CALL26 against symbol `bar'.* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/farcall-bl-none-function.s b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-bl-none-function.s new file mode 100644 index 0000000..89aa85a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-bl-none-function.s @@ -0,0 +1,16 @@ + .global _start + .global bar + +# We will place the section .text at 0x1000. + + .text + +_start: + bl bar + ret + +# We will place the section .foo at 0x8001000. + + .section .foo, "xa" +bar: + ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/farcall-bl.d b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-bl.d new file mode 100644 index 0000000..2bdd2c4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-bl.d @@ -0,0 +1,23 @@ +#name: aarch64-farcall-bl +#source: farcall-bl.s +#as: +#ld: -Ttext 0x1000 --section-start .foo=0x8001000 +#objdump: -dr +#... + +Disassembly of section .text: + +0000000000001000 <_start>: + +1000: 94000002 bl 1008 <__bar_veneer> + +1004: d65f03c0 ret + +0000000000001008 <__bar_veneer>: + 1008: 90040010 adrp x16, 8001000 <bar> + 100c: 91000210 add x16, x16, #0x0 + 1010: d61f0200 br x16 + ... + +Disassembly of section .foo: + +0000000008001000 <bar>: + 8001000: d65f03c0 ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/farcall-bl.s b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-bl.s new file mode 100644 index 0000000..432b120 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-bl.s @@ -0,0 +1,17 @@ + .global _start + .global bar + +# We will place the section .text at 0x1000. + + .text + +_start: + bl bar + ret + +# We will place the section .foo at 0x8001000. + + .section .foo, "xa" + .type bar, @function +bar: + ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/farcall-section.d b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-section.d new file mode 100644 index 0000000..85775e1 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-section.d @@ -0,0 +1,5 @@ +#name: Aarch64 farcall to symbol of type STT_SECTION +#source: farcall-section.s +#as: +#ld: -Ttext 0x1000 --section-start .foo=0x8001014 +#error: .*\(.text\+0x0\): relocation truncated to fit: R_AARCH64_CALL26 against `.foo' diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/farcall-section.s b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-section.s new file mode 100644 index 0000000..86a070c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/farcall-section.s @@ -0,0 +1,19 @@ +# Test to ensure that an Aarch64 call exceeding 128MB generates an error +# if the destination is of type STT_SECTION (eg non-global symbol) + + .global _start + +# We will place the section .text at 0x1000. + + .text + +_start: + bl bar + +# We will place the section .foo at 0x8001020. + + .section .foo, "xa" + +bar: + ret + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-got-relocs.d b/binutils-2.24/ld/testsuite/ld-aarch64/gc-got-relocs.d new file mode 100644 index 0000000..bb98241 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-got-relocs.d @@ -0,0 +1,32 @@ +#source: gc-start.s +#source: gc-relocs-309.s +#source: gc-relocs-311.s +#source: gc-relocs-312.s +#ld: --gc-sections -T aarch64.ld +#objdump: -s -t -d + +# Executable with got related relocs against global sysmbol gced. +# After gc-section removal we are cheking that symbol does not exit +# got section is empty and text section contains only start function. + +.*: file format elf64-(little|big)aarch64 + +SYMBOL TABLE: +0+8000 l d \.text 0+ \.text +0+9000 l d \.got 0+ \.got +0+0000 l df \*ABS\* 0+ .* +0+0000 l df \*ABS\* 0+ +0+9000 l O \.got 0+ _GLOBAL_OFFSET_TABLE_ +0+8000 g \.text 0+ _start + +Contents of section .text: + 8000 1f2003d5 .* +Contents of section .got: + 9000 0+ 0+ 0+ 0+ .* + 9010 0+ 0+ 0+ 0+ .* + +Disassembly of section .text: + +0+8000 \<_start>: + 8000: d503201f nop + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt-hidden.s b/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt-hidden.s new file mode 100644 index 0000000..bb6fe75 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt-hidden.s @@ -0,0 +1,7 @@ + .text + .globl hidfn + .hidden hidfn + .type hidfn, %function +hidfn: + and x0, x0, x0 + .size hidfn, . - hidfn diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt-main.s b/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt-main.s new file mode 100644 index 0000000..6f6c903 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt-main.s @@ -0,0 +1,8 @@ + .data + .global var + .text + .globl _start + .type _start, %function +_start: + bl foo + .size _start, . - _start diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt-relocs.d b/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt-relocs.d new file mode 100644 index 0000000..cb38c8d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt-relocs.d @@ -0,0 +1,48 @@ +#source: gc-plt1.s +#source: gc-plt-main.s +#source: gc-plt-hidden.s +#source: gc-plt2.s +#ld: --gc-sections -T aarch64.ld --shared +#objdump: -dT + +# Shared object with plt related relocs against global symbol +# and local functions gced. After gc-section removal we are +# checking that the function does not exist. + +.*: file format elf64-(little|big)aarch64 + +DYNAMIC SYMBOL TABLE: +0+8000 l d \.text 0+ \.text +0+8000 g DF \.text 0+4 _start +0+0000 D \*UND\* 0+ foo +0+8008 g DF \.text 0+ bar + +Disassembly of section .text: + +0+8000 \<_start\>: + 8000: 9400000c bl 8030 \<foo\+0x24\> + +0+8004 \<hidfn\>: + 8004: 8a000000 and x0, x0, x0 + +0+8008 \<bar\>: + 8008: 14000001 b 800c \<foo\> + +0+800c \<foo\>: + 800c: 97fffffe bl 8004 \<hidfn\> + +Disassembly of section .plt: + +0+8010 \<\.plt\>: + 8010: a9bf7bf0 stp x16, x30, \[sp,#-16\]! + 8014: b0000010 adrp x16, 9000 .* + 8018: f9400e11 ldr x17, \[x16,#24\] + 801c: 91006210 add x16, x16, #0x18 + 8020: d61f0220 br x17 + 8024: d503201f nop + 8028: d503201f nop + 802c: d503201f nop + 8030: b0000010 adrp x16, 9000 .* + 8034: f9401211 ldr x17, \[x16,#32\] + 8038: 91008210 add x16, x16, #0x20 + 803c: d61f0220 br x17 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt1.s b/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt1.s new file mode 100644 index 0000000..b786353 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt1.s @@ -0,0 +1,9 @@ +plt_relocs: + adrp x0, :pg_hi21:var + ldr x0, [x0, :lo12:var] + + adrp x1, :pg_hi21_nc:var + ldr x1, [x1, :lo12:var] + + b bar + bl foo diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt2.s b/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt2.s new file mode 100644 index 0000000..e9fb4cb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-plt2.s @@ -0,0 +1,11 @@ + .text + .align 2 + .global bar + .type bar, %function +bar: + b foo + + .align 2 + .type foo, %function +foo: + bl hidfn diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-257-dyn.d b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-257-dyn.d new file mode 100644 index 0000000..f1f7eb6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-257-dyn.d @@ -0,0 +1,16 @@ +#source: gc-start.s +#source: gc-relocs-257.s +#ld: --defsym tempy=0x11012 --defsym tempy2=0x45034 --defsym tempy3=0x1234 -T aarch64.ld -shared --gc-sections +#objdump: -R -d + +# This tests if the linker is able to remove dynamic relocs created +# for R_AARCH64_ABS64 while removing a gc section. The section is +# also removed. So after gc, we should be left with the startup code. + +.*: file format elf64-(little|big)aarch64 + + +Disassembly of section .text: + +0+8000 \<_start\>: + 8000: d503201f nop diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-257.d b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-257.d new file mode 100644 index 0000000..ffa7571 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-257.d @@ -0,0 +1,16 @@ +#source: gc-start.s +#source: gc-relocs-257.s +#ld: --defsym tempy=0x11012 --defsym tempy2=0x45034 --defsym tempy3=0x1234 -T aarch64.ld --gc-sections +#objdump: -d + +# This tests if linker is able to remove gc section containing +# R_AARCH64_ABS64 relocs. So after gc, we should be left with +# only the startup code. + +.*: file format elf64-(little|big)aarch64 + + +Disassembly of section .text: + +0+8000 \<_start\>: + 8000: d503201f nop diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-257.s b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-257.s new file mode 100644 index 0000000..dcc9db1 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-257.s @@ -0,0 +1,8 @@ + .text + .word tempy + .xword tempy2 + .hword tempy3 + .hword tempy3+8 + + and x0, x0, x0 + and x0, x0, #0x1 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-309.s b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-309.s new file mode 100644 index 0000000..cdafc9c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-309.s @@ -0,0 +1,6 @@ +#R_AARCH64_GOT_LD_PREL19 + .comm sym309_notused,1,8 +.text +_test_gc_rel309: + nop + ldr x1, :got:sym309_notused diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-311.s b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-311.s new file mode 100644 index 0000000..46df7d7 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-311.s @@ -0,0 +1,5 @@ +#R_AARCH64_ADR_GOT_PAGE +.comm gempy,4,4 +.text +_test_gc_rel311: + adrp x3,:got:gempy diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-312.s b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-312.s new file mode 100644 index 0000000..7a2f370 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-312.s @@ -0,0 +1,7 @@ +#R_AARCH64_GOT_LD_PREL19 + .comm sym312_notused,4 +.text +_test_gc_rel312: + nop + ldr x3, [x2, #:got_lo12:sym312_notused] + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-tlsdesc.s b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-tlsdesc.s new file mode 100644 index 0000000..413c513 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-tlsdesc.s @@ -0,0 +1,38 @@ + .global tlsdescvar + .section .tbss,"awT",%nobits + .align 2 + .type tlsdescvar, %object + .size tlsdescvar, 4 +tlsdescvar: + .zero 4 + + .align 2 + .type l_tlsdescvar, %object + .size l_tlsdescvar, 4 +l_tlsdescvar: + .zero 4 +.text +_test_tls_desc: + + // R_AARCH64_TLSDESC_ADR_PAGE tlsdescvar + adrp x0, :tlsdesc:tlsdescvar + // R_AARCH64_TLSDESC_LD64_LO12 tlsdescvar + ldr x1, [x0, :tlsdesc_lo12:tlsdescvar] + // R_AARCH64_TLSDESC_ADD_LO12 tlsdescvar + add x0, x0, :tlsdesc_lo12:tlsdescvar + // R_AARCH64_TLSDESC_CALL tlsdescvar + .tlsdesccall tlsdescvar + blr x1 + +_test_tls_desc_local: + + // R_AARCH64_TLSDESC_ADR_PAGE l_tlsdescvar + adrp x0, :tlsdesc:l_tlsdescvar + // R_AARCH64_TLSDESC_LD64_LO12 l_tlsdescvar + ldr x1, [x0, :tlsdesc_lo12:l_tlsdescvar] + // R_AARCH64_TLSDESC_ADD_LO12 l_tlsdescvar + add x0, x0, :tlsdesc_lo12:l_tlsdescvar + // R_AARCH64_TLSDESC_CALL l_tlsdescvar + .tlsdesccall l_tlsdescvar + blr x1 + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-tlsgd.s b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-tlsgd.s new file mode 100644 index 0000000..ac90475 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-tlsgd.s @@ -0,0 +1,30 @@ + .global tlsgdvar + .section .tbss,"awT",%nobits + .align 2 + .type tlsgdvar, %object + .size tlsgdvar, 4 +tlsgdvar: + .zero 4 + .align 2 + .type l_tlsgdvar, %object + .size l_tlsgdvar, 4 +l_tlsgdvar: + .zero 4 + +.text +_test_tls_gd: + // R_AARCH64_TLSGD_ADR_PAGE21 tldgdvar + adrp x0, :tlsgd:tlsgdvar + // R_AARCH64_TLSGD_ADD_LO12_NC tlsgdvar + add x0, x0, :tlsgd_lo12:tlsgdvar + // R_AARCH64_CALL26 + bl __tls_get_addr + +_test_tls_gd_local: + // R_AARCH64_TLSGD_ADR_PAGE21 l_tldgdvar + adrp x0, :tlsgd:l_tlsgdvar + // R_AARCH64_TLSGD_ADD_LO12_NC l_tlsgdvar + add x0, x0, :tlsgd_lo12:l_tlsgdvar + // R_AARCH64_CALL26 + bl __tls_get_addr + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-tlsie.s b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-tlsie.s new file mode 100644 index 0000000..e647b89 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-tlsie.s @@ -0,0 +1,29 @@ + .global tlsievar + .section .tbss,"awT",%nobits + .align 2 + .type tlsievar, %object + .size tlsievar, 4 +tlsievar: + .zero 4 + + .align 2 + .type l_tlsievar, %object + .size l_tlsievar, 4 +l_tlsievar: + .zero 4 + +.text +_test_tls_IE: + + // R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 tlsievar + adrp x0, :gottprel:tlsievar + // R_AARCH64_TLSIE_GOTTPREL_LO12_NC tlsievar + ldr x0, [x0, :gottprel_lo12:tlsievar] + +_test_tls_IE_local: + + // R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 l_tlsievar + adrp x0, :gottprel:l_tlsievar + // R_AARCH64_TLSIE_GOTTPREL_LO12_NC l_tlsievar + ldr x0, [x0, :gottprel_lo12:l_tlsievar] + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-tlsle.s b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-tlsle.s new file mode 100644 index 0000000..cca7ef0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-relocs-tlsle.s @@ -0,0 +1,36 @@ + .global tlslevar + .section .tbss,"awT",%nobits + .align 2 + .type tlslevar, %object + .size tlslevar, 4 +tlslevar: + .zero 4 + + .align 2 + .type l_tlslevar, %object + .size l_tlslevar, 4 +l_tlslevar: + .zero 4 + +.text +l_test_tls_le: + + // R_AARCH64_TLSLE_ADD_TPREL_LO12 tlslevar + add x0, x1, :tprel_lo12:tlslevar + // R_AARCH64_TLSLE_ADD_TPREL_HI12 tlslevar + add x0, x1, :tprel_hi12:tlslevar + // R_AARCH64_TLSLE_ADD_TPREL_HI12 tlslevar + add x0, x1, :tprel_hi12:tlslevar, lsl #12 + // R_AARCH64_TLSLE_ADD_TPREL_LO12_NC tlslevar + add x0, x1, :tprel_lo12_nc:tlslevar + +l_test_tls_le_local: + + // R_AARCH64_TLSLE_ADD_TPREL_LO12 l_tlslevar + add x0, x1, :tprel_lo12:l_tlslevar + // R_AARCH64_TLSLE_ADD_TPREL_HI12 l_tlslevar + add x0, x1, :tprel_hi12:l_tlslevar + // R_AARCH64_TLSLE_ADD_TPREL_HI12 l_tlslevar + add x0, x1, :tprel_hi12:l_tlslevar, lsl #12 + // R_AARCH64_TLSLE_ADD_TPREL_LO12_NC l_tlslevar + add x0, x1, :tprel_lo12_nc:l_tlslevar diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-start.s b/binutils-2.24/ld/testsuite/ld-aarch64/gc-start.s new file mode 100644 index 0000000..58d42a6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-start.s @@ -0,0 +1,4 @@ + .global _start + .text +_start: + nop diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/gc-tls-relocs.d b/binutils-2.24/ld/testsuite/ld-aarch64/gc-tls-relocs.d new file mode 100644 index 0000000..5380bc0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/gc-tls-relocs.d @@ -0,0 +1,34 @@ +#source: gc-start.s +#source: gc-relocs-tlsgd.s +#source: gc-relocs-tlsdesc.s +#source: gc-relocs-tlsie.s +#source: gc-relocs-tlsle.s +#ld: --gc-sections -T aarch64.ld +#objdump: -s -t -d + +# Executable with tls related relocs against global and local symbol gced. +# After gc-section removal we are cheking that symbols does not exit +# got section is empty and text section contains only start function. + +.*: file format elf64-(little|big)aarch64 + +SYMBOL TABLE: +0+8000 l d \.text 0+ \.text +0+9000 l d \.got 0+ \.got +0+0000 l df \*ABS\* 0+ .* +0+0000 l \*UND\* 0+ __tls_get_addr +0+0000 l df \*ABS\* 0+ +0+9000 l O \.got 0+ _GLOBAL_OFFSET_TABLE_ +0+8000 g \.text 0+ _start + +Contents of section .text: + 8000 1f2003d5 .* +Contents of section .got: + 9000 0+ 0+ 0+ 0+ .* + 9010 0+ 0+ 0+ 0+ .* + +Disassembly of section .text: + +0+8000 \<_start>: + 8000: d503201f nop + diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-1-local.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-1-local.d new file mode 100644 index 0000000..0e307e0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-1-local.d @@ -0,0 +1,7 @@ +#ld: -shared +#objdump: -dw +#target: aarch64*-*-* + +#... +[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+(0x2a0|0x2f0)@plt> +#pass diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-1-local.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-1-local.s new file mode 100644 index 0000000..7b9d117 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-1-local.s @@ -0,0 +1,13 @@ + .type foo, %gnu_indirect_function + .set __GI_foo, foo + .text + .type foo, @function +foo: + ret + .size foo, .-foo +.globl bar + .type bar, @function +bar: + bl __GI_foo + ret + .size bar, .-bar diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-1.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-1.d new file mode 100644 index 0000000..9e522c9 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-1.d @@ -0,0 +1,7 @@ +#ld: -shared +#objdump: -dw +#target: aarch64*-*-* + +#... +[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+(0x2c0|0x308)@plt> +#pass diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-1.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-1.s new file mode 100644 index 0000000..6f86c8a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-1.s @@ -0,0 +1,16 @@ + .type foo, %gnu_indirect_function + .global __GI_foo + .hidden __GI_foo + .set __GI_foo, foo + .text +.globl foo + .type foo, @function +foo: + ret + .size foo, .-foo +.globl bar + .type bar, @function +bar: + bl __GI_foo + ret + .size bar, .-bar diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-10.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-10.d new file mode 100644 index 0000000..782b078 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-10.d @@ -0,0 +1,5 @@ +#ld: -e bar --gc-sections +#readelf: -r --wide +#target: aarch64*-*-* + +There are no relocations in this file. diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-10.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-10.s new file mode 100644 index 0000000..10468c1 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-10.s @@ -0,0 +1,25 @@ + .section .text.foo,"ax",@progbits + .type foo, @function +foo: + .global foo + adrp x0, :got:ifunc + ldr x0, [x0, #:got_lo12:ifunc] + bl ifunc + adrp x0, xxx + add x0, x0, :lo12:xxx + ret + + .section .text.bar,"ax",@progbits + .type bar, @function +bar: + .global bar + ret + + .section .text.ifunc,"ax",@progbits + .type ifunc, @gnu_indirect_function +ifunc: + ret + + .section .data.foo,"aw",@progbits +xxx: + .quad ifunc diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-11.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-11.d new file mode 100644 index 0000000..782b078 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-11.d @@ -0,0 +1,5 @@ +#ld: -e bar --gc-sections +#readelf: -r --wide +#target: aarch64*-*-* + +There are no relocations in this file. diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-11.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-11.s new file mode 100644 index 0000000..e1820de --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-11.s @@ -0,0 +1,26 @@ + .section .text.foo,"ax",@progbits + .type foo, @function +foo: + .global foo + adrp x0, :got:ifunc + ldr x0, [x0, #:got_lo12:ifunc] + bl ifunc + adrp x0, xxx + add x0, x0, :lo12:xxx + ret + + .section .text.bar,"ax",@progbits + .type bar, @function +bar: + .global bar + ret + + .section .text.ifunc,"ax",@progbits + .type ifunc, @gnu_indirect_function + .global ifunc +ifunc: + ret + + .section .data.foo,"aw",@progbits +xxx: + .quad ifunc diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-12.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-12.d new file mode 100644 index 0000000..8fa8ce0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-12.d @@ -0,0 +1,5 @@ +#ld: -shared -e bar --gc-sections +#readelf: -r --wide +#target: aarch64*-*-* + +There are no relocations in this file. diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-12.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-12.s new file mode 100644 index 0000000..aad30df --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-12.s @@ -0,0 +1,24 @@ + .section .text.foo,"ax",@progbits + .type foo, @function +foo: + adrp x0, :got:ifunc + ldr x0, [x0, #:got_lo12:ifunc] + bl ifunc + adrp x0, xxx + add x0, x0, :lo12:xxx + ret + + .section .text.bar,"ax",@progbits + .type bar, @function +bar: + .global bar + ret + + .section .text.ifunc,"ax",@progbits + .type ifunc, @gnu_indirect_function +ifunc: + ret + + .section .data.foo,"aw",@progbits +xxx: + .quad ifunc diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-13.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-13.d new file mode 100644 index 0000000..e1b5c10 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-13.d @@ -0,0 +1,13 @@ +#source: ifunc-13a.s +#source: ifunc-13b.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.ifunc' at offset 0x[0-9a-f]+ contains 1 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_ABS64[ ]+ifunc\(\)[ ]+ifunc \+ 0 + +Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_JUMP_SLOT[ ]+ifunc\(\)[ ]+ifunc \+ 0 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-13a.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-13a.s new file mode 100644 index 0000000..873e06e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-13a.s @@ -0,0 +1,11 @@ + .text + .type foo, @function + .global foo +foo: + adrp x0, xxx + add x0, x0, :lo12:xxx + ret + + .data +xxx: + .quad ifunc diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-13b.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-13b.s new file mode 100644 index 0000000..3560394 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-13b.s @@ -0,0 +1,5 @@ + .text + .type ifunc, @gnu_indirect_function + .globl ifunc +ifunc: + ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14a.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14a.d new file mode 100644 index 0000000..ff580d0 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14a.d @@ -0,0 +1,10 @@ +#source: ifunc-14a.s +#source: ifunc-14b.s +#ld: -shared -z nocombreloc +#readelf: -d +#target: aarch64*-*-* + +#failif +#... +.*\(TEXTREL\).* +#... diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14a.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14a.s new file mode 100644 index 0000000..7d6183c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14a.s @@ -0,0 +1,7 @@ + .text + .globl bar + .type bar, @function +bar: + bl foo + .size bar, .-bar + .hidden foo diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14b.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14b.d new file mode 100644 index 0000000..52ed2b4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14b.d @@ -0,0 +1,10 @@ +#source: ifunc-14b.s +#source: ifunc-14a.s +#ld: -shared -z nocombreloc +#readelf: -d +#target: aarch64*-*-* + +#failif +#... +.*\(TEXTREL\).* +#... diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14b.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14b.s new file mode 100644 index 0000000..bac22eb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14b.s @@ -0,0 +1,5 @@ + .type foo, %gnu_indirect_function + .globl foo +foo: + ret + .size foo, .-foo diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14c.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14c.d new file mode 100644 index 0000000..a83126f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14c.d @@ -0,0 +1,10 @@ +#source: ifunc-14a.s +#source: ifunc-14b.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +#failif +#... +.* +R_AARCH64_NONE +.* +#... diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14c.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14c.s new file mode 100644 index 0000000..7853280 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14c.s @@ -0,0 +1,7 @@ + .text + .globl xxx + .type xxx, @function +xxx: + bl foo + .size xxx, .-xxx + .hidden foo diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14d.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14d.d new file mode 100644 index 0000000..4ae88d2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14d.d @@ -0,0 +1,10 @@ +#source: ifunc-14b.s +#source: ifunc-14a.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +#failif +#... +.* +R_AARCH64_NONE +.* +#... diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14e.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14e.d new file mode 100644 index 0000000..62de35e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14e.d @@ -0,0 +1,11 @@ +#source: ifunc-14a.s +#source: ifunc-14c.s +#source: ifunc-14b.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +#failif +#... +.* +R_AARCH64_NONE +.* +#... diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14f.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14f.d new file mode 100644 index 0000000..ab8bdbf --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-14f.d @@ -0,0 +1,11 @@ +#source: ifunc-14a.s +#source: ifunc-14b.s +#source: ifunc-14c.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +#failif +#... +.* +R_AARCH64_NONE +.* +#... diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-15.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-15.d new file mode 100644 index 0000000..51d9242 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-15.d @@ -0,0 +1,12 @@ +#source: ifunc-15.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.got' at offset 0x[0-9a-f]+ contains 1 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_GLOB_DAT[ ]+ifunc\(\)[ ]+ifunc \+ 0 + +Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_JUMP_SLOT[ ]+ifunc\(\)[ ]+ifunc \+ 0 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-15.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-15.s new file mode 100644 index 0000000..f94b4a6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-15.s @@ -0,0 +1,11 @@ + .text + .type foo, @function + .global foo +foo: + adrp x0, :got:ifunc + ldr x0, [x0, #:got_lo12:ifunc] + ret + .type ifunc, @gnu_indirect_function + .globl ifunc +ifunc: + ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-16.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-16.d new file mode 100644 index 0000000..31ec162 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-16.d @@ -0,0 +1,9 @@ +#source: ifunc-16.s +#ld: -shared +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_JUMP_SLOT[ ]+0+[ ]+ifunc \+ 0 +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-16.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-16.s new file mode 100644 index 0000000..ded401a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-16.s @@ -0,0 +1,17 @@ + .text + .globl fct + .type fct, @gnu_indirect_function + .set fct,resolve + .hidden int_fct + .globl int_fct + .set int_fct,fct + .p2align 4,,15 + .type resolve, @function +resolve: + bl ifunc + .size resolve, .-resolve + .globl g + .type g, @function +g: + bl int_fct + .size g, .-g diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-17a.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-17a.d new file mode 100644 index 0000000..a87de7c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-17a.d @@ -0,0 +1,9 @@ +#source: ifunc-17a.s +#source: ifunc-17b.s +#ld: -static +#readelf: -s --wide +#target: aarch64*-*-* + +#... + +[0-9]+: +[0-9a-f]+ +4 +OBJECT +GLOBAL +DEFAULT +[1-9] foo +#pass diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-17a.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-17a.s new file mode 100644 index 0000000..e0bde49 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-17a.s @@ -0,0 +1,11 @@ + .globl main + .globl start + .globl _start + .globl __start + .text +main: +start: +_start: +__start: + .byte 0 + .common foo,4,4 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-17b.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-17b.d new file mode 100644 index 0000000..9286a9f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-17b.d @@ -0,0 +1,9 @@ +#source: ifunc-17b.s +#source: ifunc-17a.s +#ld: -static +#readelf: -s --wide +#target: aarch64*-*-* + +#... + +[0-9]+: +[0-9a-f]+ +4 +OBJECT +GLOBAL +DEFAULT +[1-9] foo +#pass diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-17b.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-17b.s new file mode 100644 index 0000000..66abe04 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-17b.s @@ -0,0 +1,6 @@ + .weak foo + .type foo, %gnu_indirect_function + .size foo,1 + .text +foo: + .byte 1 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-18a.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-18a.d new file mode 100644 index 0000000..3db91d3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-18a.d @@ -0,0 +1,14 @@ +#source: ifunc-18a.s +#source: ifunc-18b.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.ifunc' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-18a.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-18a.s new file mode 100644 index 0000000..c29c121 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-18a.s @@ -0,0 +1,5 @@ + .section .data.rel,"aw",@progbits + .globl foo_ptrt + .type foo_ptr, @object +foo_ptr: + .dc.a foo diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-18b.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-18b.d new file mode 100644 index 0000000..b27f526 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-18b.d @@ -0,0 +1,14 @@ +#source: ifunc-18b.s +#source: ifunc-18a.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.ifunc' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-18b.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-18b.s new file mode 100644 index 0000000..2e46c1e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-18b.s @@ -0,0 +1,15 @@ + .text + .type foo, %gnu_indirect_function + .hidden foo + .globl foo +foo: + ret + .size foo, .-foo + .globl bar +bar: + bl foo1 + ret + .size bar, .-bar + .hidden foo1 + .globl foo1 + foo1 = foo diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-19a.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-19a.d new file mode 100644 index 0000000..dd82b24 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-19a.d @@ -0,0 +1,13 @@ +#source: ifunc-19a.s +#source: ifunc-19b.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.ifunc' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-19a.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-19a.s new file mode 100644 index 0000000..3a3d0cd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-19a.s @@ -0,0 +1,5 @@ + .section .data.rel,"aw",@progbits + .globl foo_ptrt + .type foo_ptr, @object +foo_ptr: + .dc.a foo1 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-19b.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-19b.d new file mode 100644 index 0000000..1e0819c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-19b.d @@ -0,0 +1,13 @@ +#source: ifunc-19b.s +#source: ifunc-19a.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.ifunc' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-19b.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-19b.s new file mode 100644 index 0000000..2e46c1e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-19b.s @@ -0,0 +1,15 @@ + .text + .type foo, %gnu_indirect_function + .hidden foo + .globl foo +foo: + ret + .size foo, .-foo + .globl bar +bar: + bl foo1 + ret + .size bar, .-bar + .hidden foo1 + .globl foo1 + foo1 = foo diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-2-local.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-2-local.d new file mode 100644 index 0000000..103f3e4 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-2-local.d @@ -0,0 +1,9 @@ +#ld: -shared +#objdump: -dw +#target: aarch64*-*-* + +#... +[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+(0x2a0|0x2f0)@plt> +[ \t0-9a-f]+:[ \t0-9a-f]+adrp[ \t]+x0, 0 <.*> +[ \t0-9a-f]+:[ \t0-9a-f]+add[ \t]+x0, x0, #(0x290|0x2e0) +#pass diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-2-local.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-2-local.s new file mode 100644 index 0000000..632c31f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-2-local.s @@ -0,0 +1,15 @@ + .type foo, %gnu_indirect_function + .set __GI_foo, foo + .text + .type foo, @function +foo: + ret + .size foo, .-foo +.globl bar + .type bar, @function +bar: + bl __GI_foo + adrp x0, __GI_foo + add x0, x0, :lo12:__GI_foo + ret + .size bar, .-bar diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-2.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-2.d new file mode 100644 index 0000000..70ce224 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-2.d @@ -0,0 +1,9 @@ +#ld: -shared +#objdump: -dw +#target: aarch64*-*-* + +#... +[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+(0x2c0|0x308)@plt> +[ \t0-9a-f]+:[ \t0-9a-f]+adrp[ \t]+x0, 0 <.*> +[ \t0-9a-f]+:[ \t0-9a-f]+add[ \t]+x0, x0, #(0x2b0|0x2f8) +#pass diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-2.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-2.s new file mode 100644 index 0000000..da350df --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-2.s @@ -0,0 +1,18 @@ + .type foo, %gnu_indirect_function + .global __GI_foo + .hidden __GI_foo + .set __GI_foo, foo + .text +.globl foo + .type foo, @function +foo: + ret + .size foo, .-foo +.globl bar + .type bar, @function +bar: + bl __GI_foo + adrp x0, __GI_foo + add x0, x0, :lo12:__GI_foo + ret + .size bar, .-bar diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-20.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-20.d new file mode 100644 index 0000000..3380479 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-20.d @@ -0,0 +1,12 @@ +#source: ifunc-20.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.ifunc' at offset 0x[0-9a-f]+ contains 1 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_ABS64[ ]+ifunc\(\)[ ]+ifunc \+ 0 + +Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_JUMP_SLOT[ ]+ifunc\(\)[ ]+ifunc \+ 0 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-20.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-20.s new file mode 100644 index 0000000..17393cb --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-20.s @@ -0,0 +1,16 @@ + .section .data.rel,"aw",@progbits + .globl ifunc_ptrt + .type ifunc_ptr, @object +ifunc_ptr: + .dc.a ifunc + .text + .type ifunc, @gnu_indirect_function + .globl ifunc +ifunc: + ret + .size ifunc, .-ifunc + .type bar, @function + .globl bar +bar: + bl ifunc + .size bar, .-bar diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-3.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-3.s new file mode 100644 index 0000000..c68b1b7 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-3.s @@ -0,0 +1,16 @@ + .type foo, %gnu_indirect_function + .global __GI_foo + .protected __GI_foo + .set __GI_foo, foo + .text +.globl foo + .type foo, @function +foo: + ret + .size foo, .-foo +.globl bar + .type bar, @function +bar: + bl __GI_foo + ret + .size bar, .-bar diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-3a.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-3a.d new file mode 100644 index 0000000..4f61a8b --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-3a.d @@ -0,0 +1,8 @@ +#source: ifunc-3.s +#ld: -shared +#objdump: -dw +#target: aarch64*-*-* + +#... +[ \t0-9a-f]+:[ \t0-9a-f]+bl[ \t0-9a-f]+<\*ABS\*\+(0x2e0|0x330)@plt> +#pass diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-3b.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-3b.d new file mode 100644 index 0000000..7e177a6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-3b.d @@ -0,0 +1,8 @@ +#source: ifunc-3.s +#ld: -shared +#readelf: -r --wide +#target: aarch64*-*-* + +#... +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_[_0-9A-Z]+_IRELATIVE[ ]*[0-9a-f]* +#pass diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-4.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-4.d new file mode 100644 index 0000000..5e69b05 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-4.d @@ -0,0 +1,7 @@ +#ld: +#readelf: -r --wide +#target: aarch64*-*-* + +#... +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_[_0-9A-Z]+_IRELATIVE[ ]*[0-9a-f]* +#pass diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-4.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-4.s new file mode 100644 index 0000000..c2b66f5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-4.s @@ -0,0 +1,18 @@ + .text + .type foo, %gnu_indirect_function +.globl foo + .type foo, @function +foo: + ret + .size foo, .-foo + .type start,"function" + .global start +start: + .type _start,"function" + .global _start +_start: + .type __start,"function" + .global __start +__start: + .type __start,"function" + bl foo diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-4a.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-4a.d new file mode 100644 index 0000000..801e6cd --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-4a.d @@ -0,0 +1,8 @@ +#ld: -s +#readelf: -r --wide +#target: aarch64*-*-* +#source: ifunc-4.s + +#... +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_[_0-9A-Z]+_IRELATIVE[ ]*[0-9a-f]* +#pass diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5-local.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5-local.s new file mode 100644 index 0000000..8d23bab --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5-local.s @@ -0,0 +1,19 @@ + .text + .type foo, %gnu_indirect_function + .type foo, @function +foo: + ret + .size foo, .-foo + .type start,"function" + .global start +start: + .type _start,"function" + .global _start +_start: + .type __start,"function" + .global __start +__start: + .type __start,"function" + bl foo + adrp x0, :got:foo + ldr x0, [x0, #:got_lo12:foo] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5.s new file mode 100644 index 0000000..b1bbf1a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5.s @@ -0,0 +1,20 @@ + .text + .type foo, %gnu_indirect_function +.globl foo + .type foo, @function +foo: + ret + .size foo, .-foo + .type start,"function" + .global start +start: + .type _start,"function" + .global _start +_start: + .type __start,"function" + .global __start +__start: + .type __start,"function" + bl foo + adrp x0, :got:foo + ldr x0, [x0, #:got_lo12:foo] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5a-local.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5a-local.d new file mode 100644 index 0000000..9693585 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5a-local.d @@ -0,0 +1,8 @@ +#source: ifunc-5-local.s +#ld: +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5a.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5a.d new file mode 100644 index 0000000..f0ee59f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5a.d @@ -0,0 +1,8 @@ +#source: ifunc-5.s +#ld: +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5b-local.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5b-local.d new file mode 100644 index 0000000..e8e620c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5b-local.d @@ -0,0 +1,8 @@ +#source: ifunc-5-local.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5b.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5b.d new file mode 100644 index 0000000..0175982 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5b.d @@ -0,0 +1,12 @@ +#source: ifunc-5.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.got' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_GLOB_DAT[ ]+foo\(\)[ ]+foo \+ 0 +#... +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_JUMP_SLOT[ ]+foo\(\)[ ]+foo \+ 0 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5r-local.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5r-local.d new file mode 100644 index 0000000..463cd25 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-5r-local.d @@ -0,0 +1,10 @@ +#source: ifunc-5-local.s +#ld: -r +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.text' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_CALL26[ ]+foo\(\)[ ]+foo \+ 0 +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_ADR_GOT_PAGE[ ]+foo\(\)[ ]+foo \+ 0 +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_LD64_GOT_LO1[ ]+foo\(\)[ ]+foo \+ 0 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-6.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-6.s new file mode 100644 index 0000000..56486d6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-6.s @@ -0,0 +1,21 @@ + .text + .type foo, %gnu_indirect_function +.globl foo + .type foo, @function +foo: + ret + .size foo, .-foo + .protected foo + .type start,"function" + .global start +start: + .type _start,"function" + .global _start +_start: + .type __start,"function" + .global __start +__start: + .type __start,"function" + bl foo + adrp x0, :got:foo + ldr x0, [x0, #:got_lo12:foo] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-6a.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-6a.d new file mode 100644 index 0000000..a50ad3a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-6a.d @@ -0,0 +1,8 @@ +#source: ifunc-6.s +#ld: +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-6b.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-6b.d new file mode 100644 index 0000000..c415bc3 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-6b.d @@ -0,0 +1,12 @@ +#source: ifunc-6.s +#ld: -shared -z nocombreloc +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.got' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_GLOB_DAT[ ]+foo\(\)[ ]+foo \+ 0 +#... +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-7.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-7.s new file mode 100644 index 0000000..51485af --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-7.s @@ -0,0 +1,21 @@ + .text + .type foo, %gnu_indirect_function +.globl foo + .type foo, @function +foo: + ret + .size foo, .-foo + .hidden foo + .type start,"function" + .global start +start: + .type _start,"function" + .global _start +_start: + .type __start,"function" + .global __start +__start: + .type __start,"function" + bl foo + adrp x0, :got:foo + ldr x0, [x0, #:got_lo12:foo] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-7a.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-7a.d new file mode 100644 index 0000000..c246c99 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-7a.d @@ -0,0 +1,8 @@ +#source: ifunc-7.s +#ld: +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-7b.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-7b.d new file mode 100644 index 0000000..efdd379 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-7b.d @@ -0,0 +1,8 @@ +#source: ifunc-7.s +#ld: -shared +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-7c.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-7c.d new file mode 100644 index 0000000..1967742 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-7c.d @@ -0,0 +1,19 @@ +#source: ifunc-7.s +#ld: -shared +#objdump: -dr -j .text +#target: aarch64*-*-* + +# Check if adrp and ldr have been relocated correctly. + +.*: file format elf.+aarch64.* + + +Disassembly of section \.text: + +[0-9a-f]+ <foo>: + [0-9a-f]+: d65f03c0 ret + +[0-9a-f]+ <__start>: + [0-9a-f]+: [0-9a-f]+ bl [0-9a-f]+ <\*ABS\*\+0x[0-9a-f]+@plt> + [0-9a-f]+: [0-9a-f]+ adrp x0, [0-9]+ <__start\+0x[0-9a-f]+> + [0-9a-f]+: [0-9a-f]+ ldr x0, \[x0,.+\] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-8.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-8.d new file mode 100644 index 0000000..8aadc51 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-8.d @@ -0,0 +1,9 @@ +#source: ifunc-8a.s +#source: ifunc-8b.s +#ld: +#readelf: -r --wide +#target: aarch64*-*-* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_AARCH64_IRELATIVE[ ]+[0-9a-f]* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-8a.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-8a.s new file mode 100644 index 0000000..94c073a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-8a.s @@ -0,0 +1,13 @@ + .text + .type start,"function" + .global start +start: + .type _start,"function" + .global _start +_start: + .type __start,"function" + .global __start +__start: + .type __start,"function" + adrp x0, :got:foo + ldr x0, [x0, #:got_lo12:foo] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-8b.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-8b.s new file mode 100644 index 0000000..1f108f8 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-8b.s @@ -0,0 +1,7 @@ + .text + .type foo, %gnu_indirect_function +.globl foo + .type foo, @function +foo: + ret + .size foo, .-foo diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-9.d b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-9.d new file mode 100644 index 0000000..3b4e995 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-9.d @@ -0,0 +1,3 @@ +#ld: --export-dynamic +#error: .*dynamic STT_GNU_IFUNC symbol `foo' with pointer equality in `.*.o' can not be used when making an executable; recompile with -fPIE and relink with -pie +#target: aarch64*-*-* diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-9.s b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-9.s new file mode 100644 index 0000000..2e2f577 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/ifunc-9.s @@ -0,0 +1,23 @@ + .text + .type foo, %gnu_indirect_function +.globl foo + .type foo, @function +foo: + ret + .size foo, .-foo + .type start,"function" + .global start +start: + .type _start,"function" + .global _start +_start: + .type __start,"function" + .global __start +__start: + .type __start,"function" + adrp x0, .LANCHOR0 + add x0, x0, :lo12:.LANCHOR0 + .data + .align 3 +.LANCHOR0 = . + 0 + .xword foo diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/limit-b.d b/binutils-2.24/ld/testsuite/ld-aarch64/limit-b.d new file mode 100644 index 0000000..95d4c8f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/limit-b.d @@ -0,0 +1,17 @@ +#name: aarch64-limit-b +#source: limit-b.s +#as: +#ld: -Ttext 0x1000 --section-start .foo=0x8000ffc +#objdump: -dr +#... + +Disassembly of section .text: + +0000000000001000 <_start>: + 1000: 15ffffff b 8000ffc <bar> + 1004: d65f03c0 ret + +Disassembly of section .foo: + +0000000008000ffc <bar>: + 8000ffc: d65f03c0 ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/limit-b.s b/binutils-2.24/ld/testsuite/ld-aarch64/limit-b.s new file mode 100644 index 0000000..2b9f432 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/limit-b.s @@ -0,0 +1,19 @@ +# Test maximum encoding range of b + + .global _start + .global bar + +# We will place the section .text at 0x1000. + + .text + +_start: + b bar + ret + +# We will place the section .foo at 0x8000ffc + + .section .foo, "xa" + .type bar, @function +bar: + ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/limit-bl.d b/binutils-2.24/ld/testsuite/ld-aarch64/limit-bl.d new file mode 100644 index 0000000..2eddeb7 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/limit-bl.d @@ -0,0 +1,17 @@ +#name: aarch64-limit-bl +#source: limit-bl.s +#as: +#ld: -Ttext 0x1000 --section-start .foo=0x8000ffc +#objdump: -dr +#... + +Disassembly of section .text: + +0000000000001000 <_start>: + 1000: 95ffffff bl 8000ffc <bar> + 1004: d65f03c0 ret + +Disassembly of section .foo: + +0000000008000ffc <bar>: + 8000ffc: d65f03c0 ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/limit-bl.s b/binutils-2.24/ld/testsuite/ld-aarch64/limit-bl.s new file mode 100644 index 0000000..72f47a5 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/limit-bl.s @@ -0,0 +1,19 @@ +# Test maximum encoding range of bl + + .global _start + .global bar + +# We will place the section .text at 0x1000. + + .text + +_start: + bl bar + ret + +# We will place the section .foo at 0x8000ffc + + .section .foo, "xa" + .type bar, @function +bar: + ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/relocs.ld b/binutils-2.24/ld/testsuite/ld-aarch64/relocs.ld new file mode 100644 index 0000000..f42176e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/relocs.ld @@ -0,0 +1,19 @@ +/* Script for ld testsuite */ +OUTPUT_ARCH(aarch64) +ENTRY(_start) +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + PROVIDE (__executable_start = 0x8000); . = 0x10000; + .text : + { + *(.before) + *(.text) + *(.after) + } =0 + . = 0x20000; + .got : { *(.got) *(.got.plt)} + . = 0x12340000; + .far : { *(.far) } + .ARM.attributes 0 : { *(.ARM.atttributes) } +} diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-desc-ie.d b/binutils-2.24/ld/testsuite/ld-aarch64/tls-desc-ie.d new file mode 100644 index 0000000..037da07 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-desc-ie.d @@ -0,0 +1,36 @@ +#source: tls-desc-ie.s +#ld: -shared -T relocs.ld -e0 +#objdump: -dr +#... + +10000: 90000080 adrp x0, 20000 <_GLOBAL_OFFSET_TABLE_> + +10004: 91004000 add x0, x0, #0x10 + +10008: 94000016 bl 10060 <v1\+0x10060> + +1000c: d503201f nop + +10010: 90000080 adrp x0, 20000 <_GLOBAL_OFFSET_TABLE_> + +10014: f9400400 ldr x0, \[x0,#8\] + +10018: d503201f nop + +1001c: d503201f nop + +10020: d53bd041 mrs x1, tpidr_el0 + +10024: 8b000020 add x0, x1, x0 + +10028: d53bd042 mrs x2, tpidr_el0 + +1002c: 90000080 adrp x0, 20000 <_GLOBAL_OFFSET_TABLE_> + +10030: f9400400 ldr x0, \[x0,#8\] + +10034: 8b000040 add x0, x2, x0 + +10038: b9400000 ldr w0, \[x0\] + +1003c: 0b000020 add w0, w1, w0 + +Disassembly of section .plt: + +0000000000010040 <.plt>: + +10040: a9bf7bf0 stp x16, x30, \[sp,#-16\]! + +10044: 90000090 adrp x16, 20000 <_GLOBAL_OFFSET_TABLE_> + +10048: f9401a11 ldr x17, \[x16,#48\] + +1004c: 9100c210 add x16, x16, #0x30 + +10050: d61f0220 br x17 + +10054: d503201f nop + +10058: d503201f nop + +1005c: d503201f nop + +10060: 90000090 adrp x16, 20000 <_GLOBAL_OFFSET_TABLE_> + +10064: f9401e11 ldr x17, \[x16,#56\] + +10068: 9100e210 add x16, x16, #0x38 + +1006c: d61f0220 br x17 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-desc-ie.s b/binutils-2.24/ld/testsuite/ld-aarch64/tls-desc-ie.s new file mode 100644 index 0000000..93fd71c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-desc-ie.s @@ -0,0 +1,32 @@ + .global v1 + .global v2 + .section .tdata,"awT",%progbits +v1: + .word 1 + + .text + +# This GD access does not relax. It consumes a double GOT slot. + + adrp x0, :tlsgd:v2 + add x0, x0, :tlsgd_lo12:v2 + bl __tls_get_addr + nop + +# Test the combination of a TLSDESC-GD and IE access to the same +# symbol. We expect the TLSDESC-GD to relax to IE. + + adrp x0, :tlsdesc:v1 + ldr x1, [x0, #:tlsdesc_lo12:v1] + add x0, x0, :tlsdesc_lo12:v1 + .tlsdesccall v1 + blr x1 + mrs x1, tpidr_el0 + add x0, x1, x0 + + mrs x2, tpidr_el0 + adrp x0, :gottprel:v1 + ldr x0, [x0, #:gottprel_lo12:v1] + add x0, x2, x0 + ldr w0, [x0] + add w0, w1, w0 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-all.d b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-all.d new file mode 100644 index 0000000..b36b634 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-all.d @@ -0,0 +1,39 @@ +#source: tls-relax-all.s +#ld: -T relocs.ld -e0 +#objdump: -dr +#... + +10000: a9bf7bfd stp x29, x30, \[sp,#-16\]! + +10004: 910003fd mov x29, sp + +10008: 90000080 adrp x0, 20000 <_GLOBAL_OFFSET_TABLE_> + +1000c: f9400400 ldr x0, \[x0,#8\] + +10010: d503201f nop + +10014: d503201f nop + +10018: d53bd041 mrs x1, tpidr_el0 + +1001c: 8b000020 add x0, x1, x0 + +10020: b9400001 ldr w1, \[x0\] + +10024: d2a00000 movz x0, #0x0, lsl #16 + +10028: f2800280 movk x0, #0x14 + +1002c: d503201f nop + +10030: d503201f nop + +10034: d53bd042 mrs x2, tpidr_el0 + +10038: 8b000040 add x0, x2, x0 + +1003c: b9400000 ldr w0, \[x0\] + +10040: 0b000021 add w1, w1, w0 + +10044: 90000080 adrp x0, 20000 <_GLOBAL_OFFSET_TABLE_> + +10048: f9400800 ldr x0, \[x0,#16\] + +1004c: d53bd041 mrs x1, tpidr_el0 + +10050: 8b000020 add x0, x1, x0 + +10054: b9400000 ldr w0, \[x0\] + +10058: 0b000021 add w1, w1, w0 + +1005c: d2a00000 movz x0, #0x0, lsl #16 + +10060: f2800380 movk x0, #0x1c + +10064: d53bd041 mrs x1, tpidr_el0 + +10068: 8b000020 add x0, x1, x0 + +1006c: b9400000 ldr w0, \[x0\] + +10070: 0b000021 add w1, w1, w0 + +10074: d53bd042 mrs x2, tpidr_el0 + +10078: d2a00000 movz x0, #0x0, lsl #16 + +1007c: f2800400 movk x0, #0x20 + +10080: 8b000040 add x0, x2, x0 + +10084: b9400000 ldr w0, \[x0\] + +10088: 0b000020 add w0, w1, w0 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-all.s b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-all.s new file mode 100644 index 0000000..1bef53d --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-all.s @@ -0,0 +1,51 @@ + .global gdesc_var_1 + .global gd_var_1 + .section .tdata,"awT",%progbits +gdesc_var_1: + .word 1 +gdesc_var_2: + .word 2 +gd_var_1: + .word 3 +gd_var_2: + .word 4 +ie_var: + .word 5 + .text + stp x29, x30, [sp, -16]! + add x29, sp, 0 + adrp x0, :tlsdesc:gdesc_var_1 + ldr x1, [x0, #:tlsdesc_lo12:gdesc_var_1] + add x0, x0, :tlsdesc_lo12:gdesc_var_1 + .tlsdesccall gdesc_var_1 + blr x1 + mrs x1, tpidr_el0 + add x0, x1, x0 + ldr w1, [x0] + adrp x0, :tlsdesc:gdesc_var_2 + ldr x2, [x0, #:tlsdesc_lo12:gdesc_var_2] + add x0, x0, :tlsdesc_lo12:gdesc_var_2 + .tlsdesccall gdesc_var_2 + blr x2 + mrs x2, tpidr_el0 + add x0, x2, x0 + ldr w0, [x0] + add w1, w1, w0 + adrp x0, :tlsgd:gd_var_1 + add x0, x0, :tlsgd_lo12:gd_var_1 + bl __tls_get_addr + nop + ldr w0, [x0] + add w1, w1, w0 + adrp x0, :tlsgd:gd_var_2 + add x0, x0, :tlsgd_lo12:gd_var_2 + bl __tls_get_addr + nop + ldr w0, [x0] + add w1, w1, w0 + mrs x2, tpidr_el0 + adrp x0, :gottprel:ie_var + ldr x0, [x0, #:gottprel_lo12:ie_var] + add x0, x2, x0 + ldr w0, [x0] + add w0, w1, w0 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gd-ie.d b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gd-ie.d new file mode 100644 index 0000000..d3783ac --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gd-ie.d @@ -0,0 +1,9 @@ +#source: tls-relax-gd-ie.s +#ld: -T relocs.ld -e0 +#objdump: -dr +#... + +10000: 90000080 adrp x0, 20000 <_GLOBAL_OFFSET_TABLE_> + +10004: f9400400 ldr x0, \[x0,#8\] + +10008: d53bd041 mrs x1, tpidr_el0 + +1000c: 8b000020 add x0, x1, x0 + +10010: b9400000 ldr w0, \[x0\] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gd-ie.s b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gd-ie.s new file mode 100644 index 0000000..88c7eec --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gd-ie.s @@ -0,0 +1,10 @@ + .global var + .section .tdata,"awT",%progbits +var: + .word 2 + .text + adrp x0, :tlsgd:var + add x0, x0, :tlsgd_lo12:var + bl __tls_get_addr + nop + ldr w0, [x0] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gd-le.d b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gd-le.d new file mode 100644 index 0000000..b5ee39c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gd-le.d @@ -0,0 +1,9 @@ +#source: tls-relax-gd-le.s +#ld: -T relocs.ld -e0 +#objdump: -dr +#... + +10000: d2a00000 movz x0, #0x0, lsl #16 + +10004: f2800200 movk x0, #0x10 + +10008: d53bd041 mrs x1, tpidr_el0 + +1000c: 8b000020 add x0, x1, x0 + +10010: b9400000 ldr w0, \[x0\] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gd-le.s b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gd-le.s new file mode 100644 index 0000000..eb6fc2f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gd-le.s @@ -0,0 +1,9 @@ + .section .tdata +var: + .word 2 + .text + adrp x0, :tlsgd:var + add x0, x0, :tlsgd_lo12:var + bl __tls_get_addr + nop + ldr w0, [x0] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-ie-2.d b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-ie-2.d new file mode 100644 index 0000000..92002de --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-ie-2.d @@ -0,0 +1,18 @@ +#source: tls-relax-gdesc-ie-2.s +#ld: -T relocs.ld -e0 +#objdump: -dr +#... + +10000: 90000080 adrp x0, 20000 <_GLOBAL_OFFSET_TABLE_> + +10004: d503201f nop + +10008: f9400400 ldr x0, \[x0,#8\] + +1000c: d503201f nop + +10010: d503201f nop + +10014: d503201f nop + +10018: d503201f nop + +1001c: d503201f nop + +10020: d503201f nop + +10024: d503201f nop + +10028: d503201f nop + +1002c: d53bd041 mrs x1, tpidr_el0 + +10030: 8b000020 add x0, x1, x0 + +10034: b9400000 ldr w0, \[x0\] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-ie-2.s b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-ie-2.s new file mode 100644 index 0000000..790b6c6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-ie-2.s @@ -0,0 +1,24 @@ +// Test TLS Desc to TLS IE relaxation when instructions are not consecutive. + + .global var + .section .tdata +var: + .word 2 + .text + adrp x0, :tlsdesc:var + nop + ldr x1, [x0, #:tlsdesc_lo12:var] + nop + nop + nop + add x0, x0, :tlsdesc_lo12:var + nop + nop + .tlsdesccall var + blr x1 + nop + mrs x1, tpidr_el0 + add x0, x1, x0 + ldr w0, [x0] + .global var + .section .tdata diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-ie.d b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-ie.d new file mode 100644 index 0000000..634a55a --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-ie.d @@ -0,0 +1,11 @@ +#source: tls-relax-gdesc-ie.s +#ld: -T relocs.ld -e0 +#objdump: -dr +#... + +10000: 90000080 adrp x0, 20000 <_GLOBAL_OFFSET_TABLE_> + +10004: f9400400 ldr x0, \[x0,#8\] + +10008: d503201f nop + +1000c: d503201f nop + +10010: d53bd041 mrs x1, tpidr_el0 + +10014: 8b000020 add x0, x1, x0 + +10018: b9400000 ldr w0, \[x0\] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-ie.s b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-ie.s new file mode 100644 index 0000000..c20690c --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-ie.s @@ -0,0 +1,13 @@ + .global var + .section .tdata +var: + .word 2 + .text + adrp x0, :tlsdesc:var + ldr x1, [x0, #:tlsdesc_lo12:var] + add x0, x0, :tlsdesc_lo12:var + .tlsdesccall var + blr x1 + mrs x1, tpidr_el0 + add x0, x1, x0 + ldr w0, [x0] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-2.d b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-2.d new file mode 100644 index 0000000..3c028e2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-2.d @@ -0,0 +1,18 @@ +#source: tls-relax-gdesc-le-2.s +#ld: -T relocs.ld -e0 +#objdump: -dr +#... + +10000: d2a00000 movz x0, #0x0, lsl #16 + +10004: d503201f nop + +10008: d503201f nop + +1000c: f2800200 movk x0, #0x10 + +10010: d503201f nop + +10014: d503201f nop + +10018: d503201f nop + +1001c: d503201f nop + +10020: d503201f nop + +10024: d503201f nop + +10028: d503201f nop + +1002c: d53bd041 mrs x1, tpidr_el0 + +10030: 8b000020 add x0, x1, x0 + +10034: b9400000 ldr w0, \[x0\] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-2.s b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-2.s new file mode 100644 index 0000000..fb8bf66 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-2.s @@ -0,0 +1,22 @@ +# Test TLS Desc to TLS LE relaxation when instructions are not consecutive. + + .section .tdata +var: + .word 2 + .text + adrp x0, :tlsdesc:var + nop + nop + ldr x1, [x0, #:tlsdesc_lo12:var] + nop + add x0, x0, :tlsdesc_lo12:var + nop + nop + nop + .tlsdesccall var + blr x1 + nop + mrs x1, tpidr_el0 + add x0, x1, x0 + ldr w0, [x0] + .section .tdata diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-le.d b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-le.d new file mode 100644 index 0000000..afe0a56 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-le.d @@ -0,0 +1,11 @@ +#source: tls-relax-gdesc-le.s +#ld: -T relocs.ld -e0 +#objdump: -dr +#... + +10000: d2a00000 movz x0, #0x0, lsl #16 + +10004: f2800200 movk x0, #0x10 + +10008: d503201f nop + +1000c: d503201f nop + +10010: d53bd041 mrs x1, tpidr_el0 + +10014: 8b000020 add x0, x1, x0 + +10018: b9400000 ldr w0, \[x0\] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-le.s b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-le.s new file mode 100644 index 0000000..28ee0f6 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-gdesc-le.s @@ -0,0 +1,12 @@ + .section .tdata +var: + .word 2 + .text + adrp x0, :tlsdesc:var + ldr x1, [x0, #:tlsdesc_lo12:var] + add x0, x0, :tlsdesc_lo12:var + .tlsdesccall var + blr x1 + mrs x1, tpidr_el0 + add x0, x1, x0 + ldr w0, [x0] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le-2.d b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le-2.d new file mode 100644 index 0000000..2f93955 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le-2.d @@ -0,0 +1,17 @@ +#source: tls-relax-ie-le-2.s +#ld: -T relocs.ld -e0 +#objdump: -dr +#... + +10000: d53bd041 mrs x1, tpidr_el0 + +10004: d503201f nop + +10008: d503201f nop + +1000c: d2a00000 movz x0, #0x0, lsl #16 + +10010: d503201f nop + +10014: d503201f nop + +10018: d503201f nop + +1001c: f2800200 movk x0, #0x10 + +10020: d503201f nop + +10024: 8b000020 add x0, x1, x0 + +10028: d503201f nop + +1002c: d503201f nop + +10030: b9400000 ldr w0, \[x0\] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le-2.s b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le-2.s new file mode 100644 index 0000000..98b62e2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le-2.s @@ -0,0 +1,20 @@ +# Test TLS IE to TLS LE relaxation when instructions are not consecutive. + + .section .tdata +var: + .word 2 + .text + mrs x1, tpidr_el0 + nop + nop + adrp x0, :gottprel:var + nop + nop + nop + ldr x0, [x0, #:gottprel_lo12:var] + nop + add x0, x1, x0 + nop + nop + ldr w0, [x0] + .section .tdata diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le-3.d b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le-3.d new file mode 100644 index 0000000..a2fd823 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le-3.d @@ -0,0 +1,9 @@ +#source: tls-relax-ie-le-3.s +#ld: -T relocs.ld -e0 +#objdump: -dr +#... + +10000: d53bd042 mrs x2, tpidr_el0 + +10004: d2a0000f movz x15, #0x0, lsl #16 + +10008: f280020f movk x15, #0x10 + +1000c: 8b0f004f add x15, x2, x15 + +10010: b94001e0 ldr w0, \[x15\] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le-3.s b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le-3.s new file mode 100644 index 0000000..70e7062 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le-3.s @@ -0,0 +1,12 @@ +# Test TLS IE to TLS LE relaxation when using arbitrary registers. + + .section .tdata +var: + .word 2 + .text + mrs x2, tpidr_el0 + adrp x15, :gottprel:var + ldr x15, [x15, #:gottprel_lo12:var] + add x15, x2, x15 + ldr w0, [x15] + .section .tdata diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le.d b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le.d new file mode 100644 index 0000000..ff3b344 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le.d @@ -0,0 +1,9 @@ +#source: tls-relax-ie-le.s +#ld: -T relocs.ld -e0 +#objdump: -dr +#... + +10000: d53bd041 mrs x1, tpidr_el0 + +10004: d2a00000 movz x0, #0x0, lsl #16 + +10008: f2800200 movk x0, #0x10 + +1000c: 8b000020 add x0, x1, x0 + +10010: b9400000 ldr w0, \[x0\] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le.s b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le.s new file mode 100644 index 0000000..093cda2 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tls-relax-ie-le.s @@ -0,0 +1,9 @@ + .section .tdata +var: + .word 2 + .text + mrs x1, tpidr_el0 + adrp x0, :gottprel:var + ldr x0, [x0, #:gottprel_lo12:var] + add x0, x1, x0 + ldr w0, [x0] diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tlsle-symbol-offset.d b/binutils-2.24/ld/testsuite/ld-aarch64/tlsle-symbol-offset.d new file mode 100644 index 0000000..cf61691 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tlsle-symbol-offset.d @@ -0,0 +1,11 @@ +#source: tlsle-symbol-offset.s +#ld: -shared -T relocs.ld -e0 +#objdump: -dr +#... +Disassembly of section .text: + +0000000000010000 <.text>: + +10000: d53bd040 mrs x0, tpidr_el0 + +10004: 91400400 add x0, x0, #0x1, lsl #12 + +10008: 91010000 add x0, x0, #0x40 + +1000c: d65f03c0 ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/tlsle-symbol-offset.s b/binutils-2.24/ld/testsuite/ld-aarch64/tlsle-symbol-offset.s new file mode 100644 index 0000000..41088ef --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/tlsle-symbol-offset.s @@ -0,0 +1,17 @@ + .global p + .global a + .section .tbss,"awT",%nobits +p: + .zero 4096 +a: + .zero 52 + + .text + +# Compute the address of an integer within structure a, padded +# by an array of size 48 + + mrs x0, tpidr_el0 + add x0, x0, #:tprel_hi12:a+48 + add x0, x0, #:tprel_lo12_nc:a+48 + ret diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/weak-undefined.d b/binutils-2.24/ld/testsuite/ld-aarch64/weak-undefined.d new file mode 100644 index 0000000..22a9860 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/weak-undefined.d @@ -0,0 +1,18 @@ +#source: weak-undefined.s +#ld: -Ttext 0xF0000000 -T relocs.ld -e0 --emit-relocs +#objdump: -d +#... + +f0000000: 54000001 b\.ne f0000000 <main> + +f0000004: 54000000 b\.eq f0000004 <main\+0x4> + +f0000008: 54000002 b\.cs f0000008 <main\+0x8> + +f000000c: 54000003 b\.cc f000000c <main\+0xc> + +f0000010: 5400000c b\.gt f0000010 <main\+0x10> + +f0000014: 5400000a b\.ge f0000014 <main\+0x14> + +f0000018: 5400000b b\.lt f0000018 <main\+0x18> + +f000001c: 5400000d b\.le f000001c <main\+0x1c> + +f0000020: d503201f nop + +f0000024: d503201f nop + +f0000028: 58000000 ldr x0, f0000028 <main\+0x28> + +f000002c: 10000000 adr x0, f000002c <main\+0x2c> + +f0000030: 90000000 adrp x0, f0000000 <main> + +f0000034: 91000000 add x0, x0, #0x0 diff --git a/binutils-2.24/ld/testsuite/ld-aarch64/weak-undefined.s b/binutils-2.24/ld/testsuite/ld-aarch64/weak-undefined.s new file mode 100644 index 0000000..692798f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-aarch64/weak-undefined.s @@ -0,0 +1,18 @@ +.text + .weak foo + .global main +main: + b.ne foo + b.eq foo + b.cs foo + b.cc foo + b.gt foo + b.ge foo + b.lt foo + b.le foo + b foo + bl foo + ldr x0, foo + adr x0, foo + adrp x0, foo + add x0, x0, :lo12:foo |