From 4b9dc14e0c15d9c1892c360846db87d4990a9ff5 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Mon, 25 Jul 2011 01:16:05 +0000 Subject: [PATCH] PR ld/12815 * ld-mmix/pr12815-1.d, ld-mmix/pr12815-1.s, ld-mmix/pr12815-1.ld, ld-mmix/pr12815-2.d, ld-mmix/pr12815-2.s: New tests. --- ld/testsuite/ChangeLog | 6 ++++++ ld/testsuite/ld-mmix/pr12815-1.d | 7 +++++++ ld/testsuite/ld-mmix/pr12815-1.ld | 14 ++++++++++++++ ld/testsuite/ld-mmix/pr12815-1.s | 26 ++++++++++++++++++++++++++ ld/testsuite/ld-mmix/pr12815-2.d | 7 +++++++ ld/testsuite/ld-mmix/pr12815-2.s | 14 ++++++++++++++ 6 files changed, 74 insertions(+) create mode 100644 ld/testsuite/ld-mmix/pr12815-1.d create mode 100644 ld/testsuite/ld-mmix/pr12815-1.ld create mode 100644 ld/testsuite/ld-mmix/pr12815-1.s create mode 100644 ld/testsuite/ld-mmix/pr12815-2.d create mode 100644 ld/testsuite/ld-mmix/pr12815-2.s diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index e42e167d8e..8400fd1a79 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2011-07-25 Hans-Peter Nilsson + + PR ld/12815 + * ld-mmix/pr12815-1.d, ld-mmix/pr12815-1.s, ld-mmix/pr12815-1.ld, + ld-mmix/pr12815-2.d, ld-mmix/pr12815-2.s: New tests. + 2011-07-24 Catherine Moore Chao-ying Fu Maciej W. Rozycki diff --git a/ld/testsuite/ld-mmix/pr12815-1.d b/ld/testsuite/ld-mmix/pr12815-1.d new file mode 100644 index 0000000000..41680b9b2c --- /dev/null +++ b/ld/testsuite/ld-mmix/pr12815-1.d @@ -0,0 +1,7 @@ +#as: -no-predefined-syms -x +#ld: -e 0x1000 -m elf64mmix -T $srcdir/$subdir/pr12815-1.ld +#error: invalid input relocation.*objcopy.*"-mno-base-addresses".*truncated + +# Check that we emit a meaningful error message rather than SEGV when +# someone attempts linking to the "binary" output format with +# -mbase-addresses in effect. diff --git a/ld/testsuite/ld-mmix/pr12815-1.ld b/ld/testsuite/ld-mmix/pr12815-1.ld new file mode 100644 index 0000000000..1658cd31b8 --- /dev/null +++ b/ld/testsuite/ld-mmix/pr12815-1.ld @@ -0,0 +1,14 @@ +OUTPUT_FORMAT("binary") +ENTRY(start) +SECTIONS +{ + . = 0x8000000000100000; + .text : AT(ADDR(.text) - 0x8000000000100000) + { + *(.text) + *(.data) + *(.rodata*) + *(COMMON*) + *(.bss*) + } +} diff --git a/ld/testsuite/ld-mmix/pr12815-1.s b/ld/testsuite/ld-mmix/pr12815-1.s new file mode 100644 index 0000000000..b03fa61ee3 --- /dev/null +++ b/ld/testsuite/ld-mmix/pr12815-1.s @@ -0,0 +1,26 @@ +# 1 "m.c" +! mmixal:= 8H LOC Data_Section + .text ! mmixal:= 9H LOC 8B + .data ! mmixal:= 8H LOC 9B + .p2align 2 + LOC @+(4-@)&3 +foo IS @ + TETRA #2 + .text ! mmixal:= 9H LOC 8B + .p2align 2 + LOC @+(4-@)&3 + .global main +main IS @ + SUBU $254,$254,8 + STOU $253,$254,0 + ADDU $253,$254,8 + LDT $0,foo + ADDU $0,$0,1 + SET $0,$0 + STTU $0,foo + SETL $0,0 + LDO $253,$254,0 + ADDU $254,$254,8 + POP 1,0 + + .data ! mmixal:= 8H LOC 9B diff --git a/ld/testsuite/ld-mmix/pr12815-2.d b/ld/testsuite/ld-mmix/pr12815-2.d new file mode 100644 index 0000000000..47966a3194 --- /dev/null +++ b/ld/testsuite/ld-mmix/pr12815-2.d @@ -0,0 +1,7 @@ +#as: -no-predefined-syms -x +#ld: -e 0x1000 --defsym bar=0x100000000 -m elf64mmix -T $srcdir/$subdir/pr12815-1.ld +#error: invalid input relocation.*objcopy.*"-no-expand".*truncated + +# Check that we emit a meaningful error message rather than SEGV when +# someone attempts linking to the "binary" output format with +# expanding PUSHJ insns, expecting relaxation to work. diff --git a/ld/testsuite/ld-mmix/pr12815-2.s b/ld/testsuite/ld-mmix/pr12815-2.s new file mode 100644 index 0000000000..16d9ad9958 --- /dev/null +++ b/ld/testsuite/ld-mmix/pr12815-2.s @@ -0,0 +1,14 @@ +# 1 "m.c" +! mmixal:= 8H LOC Data_Section + .text ! mmixal:= 9H LOC 8B + .p2align 2 + LOC @+(4-@)&3 + .global main +main IS @ + GET $0,rJ + PUSHJ $1,bar + PUSHJ $1,bar + PUT rJ,$0 + POP 1,0 + + .data ! mmixal:= 8H LOC 9B -- 2.34.1