diff options
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ld-elf/orphan-region.ld | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-riscv-elf/attr-phdr.d | 19 | ||||
-rw-r--r-- | ld/testsuite/ld-riscv-elf/attr-phdr.s | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp | 1 |
4 files changed, 30 insertions, 1 deletions
diff --git a/ld/testsuite/ld-elf/orphan-region.ld b/ld/testsuite/ld-elf/orphan-region.ld index 2abf8bc..71834df 100644 --- a/ld/testsuite/ld-elf/orphan-region.ld +++ b/ld/testsuite/ld-elf/orphan-region.ld @@ -7,5 +7,5 @@ SECTIONS { .text : ALIGN (4) { *(.text) } > region .rodata : ALIGN (4) { *(.rodata) } > region - /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.trampolines) } + /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.trampolines) *(.riscv.attributes) } } diff --git a/ld/testsuite/ld-riscv-elf/attr-phdr.d b/ld/testsuite/ld-riscv-elf/attr-phdr.d new file mode 100644 index 0000000..43f2ea5 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/attr-phdr.d @@ -0,0 +1,19 @@ +#name: PT_RISCV_ATTRIBUTES check +#source: attr-phdr.s +#as: -march=rv32ic +#ld: -m[riscv_choose_ilp32_emul] +#readelf: -l + +Elf file type is EXEC \(Executable file\) +Entry point .* +There are .* program headers, starting at offset .* + +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + RISCV_ATTRIBUT .* + LOAD .* + + Section to Segment mapping: + Segment Sections... + 00 .riscv.attributes + 01 .text diff --git a/ld/testsuite/ld-riscv-elf/attr-phdr.s b/ld/testsuite/ld-riscv-elf/attr-phdr.s new file mode 100644 index 0000000..f075248 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/attr-phdr.s @@ -0,0 +1,9 @@ + .attribute arch, "rv32i2p0_m2p0" + .option nopic + .text + .align 1 + .globl _start + .type _start, @function +_start: + ret + .size _start, .-_start diff --git a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp index 1f1245a..1f6eceb 100644 --- a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp +++ b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp @@ -112,6 +112,7 @@ if [istarget "riscv*-*-*"] { run_dump_test "attr-merge-priv-spec-failed-04" run_dump_test "attr-merge-priv-spec-failed-05" run_dump_test "attr-merge-priv-spec-failed-06" + run_dump_test "attr-phdr" run_ld_link_tests [list \ [list "Weak reference 32" "-T weakref.ld -m[riscv_choose_ilp32_emul]" "" \ "-march=rv32i -mabi=ilp32" {weakref32.s} \ |