From: Hans-Peter Nilsson Date: Mon, 4 Feb 2002 04:01:32 +0000 (+0000) Subject: * gas/mmix/basep-8.d, gas/mmix/basep-9.s, gas/mmix/basep-9.d, X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c4a42e0f58139c32ccb5d2e8d05ff2148c7b0afe;p=binutils-gdb.git * gas/mmix/basep-8.d, gas/mmix/basep-9.s, gas/mmix/basep-9.d, gas/mmix/err-bpo6.s, gas/mmix/basep-8.s, gas/mmix/basep-10.d, gas/mmix/basep-10.s, gas/mmix/basep-11.s, gas/mmix/basep-11.d: New tests for base-plus-offset relocations and global register allocations for weak and common symbols. --- diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index cf48ac9561c..c7edba15423 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2002-02-04 Hans-Peter Nilsson + + * gas/mmix/basep-8.d, gas/mmix/basep-9.s, gas/mmix/basep-9.d, + gas/mmix/err-bpo6.s, gas/mmix/basep-8.s, gas/mmix/basep-10.d, + gas/mmix/basep-10.s, gas/mmix/basep-11.s, gas/mmix/basep-11.d: New + tests for base-plus-offset relocations and global register + allocations for weak and common symbols. + 2002-02-02 Alan Modra * gas/elf/elf.exp: Don't special case v850. diff --git a/gas/testsuite/gas/mmix/basep-10.d b/gas/testsuite/gas/mmix/basep-10.d new file mode 100644 index 00000000000..6a24e9d7bfc --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-10.d @@ -0,0 +1,34 @@ +#as: -linker-allocated-gregs +#objdump: -srt + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+4 l \.text 0+ w4 +0+10 l \.text 0+ w2 +0+ l d \.MMIX\.reg_contents 0+ +0+c w \.text 0+ w1 +0+8 w \.text 0+ w3 + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+6 R_MMIX_BASE_PLUS_OFFSET w1 +0+a R_MMIX_REG \.MMIX\.reg_contents +0+e R_MMIX_REG \.MMIX\.reg_contents\+0x0+8 +0+12 R_MMIX_REG \.MMIX\.reg_contents\+0x0+8 + +RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]: +OFFSET TYPE VALUE +0+ R_MMIX_64 w3 +0+8 R_MMIX_64 \.text\+0x0+4 + +Contents of section \.text: + 0000 fd000000 232a0000 232b0000 232c000c .* + 0010 232d0000 .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000000 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/basep-10.s b/gas/testsuite/gas/mmix/basep-10.s new file mode 100644 index 00000000000..5d6ed76ba06 --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-10.s @@ -0,0 +1,16 @@ +# Test that we handle weak symbols with base-plus-offset relocs mixed with +# GREG defs. + .weak w1 + .weak w3 + GREG w4 + GREG w3 + SWYM +w4: + LDA $42,w1 +w3: + LDA $43,w3 +w1: + LDA $44,w2 +w2: + LDA $45,w4 + diff --git a/gas/testsuite/gas/mmix/basep-11.d b/gas/testsuite/gas/mmix/basep-11.d new file mode 100644 index 00000000000..36eacf9fec6 --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-11.d @@ -0,0 +1,25 @@ +#as: -linker-allocated-gregs +#objdump: -srt + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+4 l \.text 0+ w4 +0+10 l \.text 0+ w2 +0+c w \.text 0+ w1 +0+8 w \.text 0+ w3 + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+6 R_MMIX_BASE_PLUS_OFFSET w1 +0+a R_MMIX_BASE_PLUS_OFFSET w3 +0+e R_MMIX_BASE_PLUS_OFFSET \.text\+0x0+10 +0+12 R_MMIX_BASE_PLUS_OFFSET \.text\+0x0+4 + +Contents of section \.text: + 0000 fd000000 232a0000 232b0000 232c0000 .* + 0010 232d0000 .* +Contents of section \.data: diff --git a/gas/testsuite/gas/mmix/basep-11.s b/gas/testsuite/gas/mmix/basep-11.s new file mode 100644 index 00000000000..17b79037e9b --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-11.s @@ -0,0 +1,13 @@ +# Test that we handle weak symbols with base-plus-offset relocs. + .weak w1 + .weak w3 + SWYM +w4: + LDA $42,w1 +w3: + LDA $43,w3 +w1: + LDA $44,w2 +w2: + LDA $45,w4 + diff --git a/gas/testsuite/gas/mmix/basep-8.d b/gas/testsuite/gas/mmix/basep-8.d new file mode 100644 index 00000000000..71cd3abb21d --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-8.d @@ -0,0 +1,30 @@ +#as: -linker-allocated-gregs +#objdump: -drt + +# Since we don't merge BPO-relocs until linking with +# -linker-allocated-gregs, we automatically correctly handle the two +# seemingly neighboring comm-symbols that don't merge well at +# assembly-time. + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \.bss 0+4 comm_symbol3 +0+4 l \.bss 0+4 comm_symbol4 +0+4 O \*COM\* 0+4 comm_symbol1 +0+4 O \*COM\* 0+4 comm_symbol2 + +Disassembly of section \.text: + +0+ <\.text>: + 0: 232a0000 addu \$42,\$0,0 + 2: R_MMIX_BASE_PLUS_OFFSET comm_symbol1 + 4: 232b0000 addu \$43,\$0,0 + 6: R_MMIX_BASE_PLUS_OFFSET comm_symbol2 + 8: 232c0000 addu \$44,\$0,0 + a: R_MMIX_BASE_PLUS_OFFSET \.bss + c: 232d0000 addu \$45,\$0,0 + e: R_MMIX_BASE_PLUS_OFFSET \.bss\+0x4 diff --git a/gas/testsuite/gas/mmix/basep-8.s b/gas/testsuite/gas/mmix/basep-8.s new file mode 100644 index 00000000000..fd2371c8b87 --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-8.s @@ -0,0 +1,9 @@ +# Test that we handle COMM-type symbols with base-plus-offset relocs. + .comm comm_symbol1,4,4 + .lcomm comm_symbol3,4 + LDA $42,comm_symbol1 + LDA $43,comm_symbol2 + LDA $44,comm_symbol3 + LDA $45,comm_symbol4 + .comm comm_symbol2,4,4 + .lcomm comm_symbol4,4 diff --git a/gas/testsuite/gas/mmix/basep-9.d b/gas/testsuite/gas/mmix/basep-9.d new file mode 100644 index 00000000000..9bc91559340 --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-9.d @@ -0,0 +1,29 @@ +#objdump: -srt + +.*: file format elf64-mmix + +SYMBOL TABLE: +0+ l d \.text 0+ +0+ l d \.data 0+ +0+ l d \.bss 0+ +0+ l \.bss 0+4 comm_symbol3 +0+4 l \.bss 0+4 comm_symbol4 +0+ l d \.MMIX\.reg_contents 0+ +0+4 O \*COM\* 0+4 comm_symbol1 + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+2 R_MMIX_REG \.MMIX\.reg_contents\+0x0+8 +0+6 R_MMIX_REG \.MMIX\.reg_contents +0+a R_MMIX_REG \.MMIX\.reg_contents + +RELOCATION RECORDS FOR \[\.MMIX\.reg_contents\]: +OFFSET TYPE VALUE +0+ R_MMIX_64 \.bss +0+8 R_MMIX_64 comm_symbol1 + +Contents of section \.text: + 0000 232a0000 232c0000 232d0004 .* +Contents of section \.data: +Contents of section \.MMIX\.reg_contents: + 0000 00000000 00000000 00000000 00000000 .* diff --git a/gas/testsuite/gas/mmix/basep-9.s b/gas/testsuite/gas/mmix/basep-9.s new file mode 100644 index 00000000000..d36326e994e --- /dev/null +++ b/gas/testsuite/gas/mmix/basep-9.s @@ -0,0 +1,9 @@ +# Test that we handle COMM-type symbols with base-plus-offset relocs. + .comm comm_symbol1,4,4 + .lcomm comm_symbol3,4 + GREG comm_symbol1 + GREG comm_symbol3 + LDA $42,comm_symbol1 + LDA $44,comm_symbol3 + LDA $45,comm_symbol4 + .lcomm comm_symbol4,4 diff --git a/gas/testsuite/gas/mmix/err-bpo6.s b/gas/testsuite/gas/mmix/err-bpo6.s new file mode 100644 index 00000000000..7efe1f7a679 --- /dev/null +++ b/gas/testsuite/gas/mmix/err-bpo6.s @@ -0,0 +1,21 @@ +% { dg-do assemble { target mmix-*-* } } + +# Test that we handle COMM-type symbols with base-plus-offset relocs, but +# that we don't merge ones that may be separately merged with other +# symbols at link-time. Likewise for weak symbols. + .comm comm_symbol1,4,4 + .lcomm comm_symbol3,4 + GREG comm_symbol1 + GREG comm_symbol3 + GREG xx + .weak xx +xx: + LDA $47,yy % { dg-error "no suitable GREG definition" "" } + LDA $46,xx + LDA $42,comm_symbol1 + LDA $43,comm_symbol2 % { dg-error "no suitable GREG definition" "" } + LDA $44,comm_symbol3 + LDA $45,comm_symbol4 +yy: + .comm comm_symbol2,4,4 + .lcomm comm_symbol4,4