This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[patch] Fix a few testcase issuess that caused mips-linux failures
- To: binutils at sourceware dot cygnus dot com
- Subject: [patch] Fix a few testcase issuess that caused mips-linux failures
- From: cgd at sibyte dot com (Chris G. Demetriou)
- Date: 18 Oct 2000 14:57:36 -0700
When creating ELF output files, the assembler checks to see if the
target OS is "elf". If not, the assembler sets the section alignment
for text, data, and bss to be 16 bytes. For mips-linux (and other
non-generic ELF targets), this means that there'll be padding bytes in
the output, and not all of the test cases go out of their way to
accomodate this.
The patch below fixes a few of those issues.
It's actually consists of independent changes to each of several MIPS
tests. Blank lines in the ChangeLog entries delineate each
independent change.
The patch applies from src, but only changes stuff in
src/gas/testsuite/gas/mips. It does _not_ need any of my previous
changes applied first.
Verified to not introduce any failures in mips-elf or mips64-elf.
chris
=============================================================================
for gas/testsuite/ChangeLog
2000-10-18 Chris Demetriou <cgd@sibyte.com>
* gas/mips/elf_e_flags.s: Add padding to the end of the
file so that objdump output will be consistent.
* gas/mips/elf_e_flags1.d, gas/mips/elf_e_flags2.d,
gas/mips/elf_e_flags3.d, gas/mips/elf_e_flags4.d: Expect
"..." at end of objdump output because of zero bytes at end
of section.
* gas/mips/elf_e_flags.c: Add note to comment about
what's changing in elf_e_flags.s.
* gas/mips/la.s: Add padding to the end of the file so that
objdump output will be consistent.
* gas/mips/la-svr4pic.d, gas/mips/la-xgot.d: Expect "..." at
end of objdump output because of zero bytes at end of
section.
* gas/mips/sync.s: Add padding to the end of the file so that
objdump output will be consistent.
* gas/mips/sync.d: Expect "..." at end of objdump output
because of zero bytes at end of section.
diff -rc ../src.P09/gas/testsuite/gas/mips/elf_e_flags.c ./gas/testsuite/gas/mips/elf_e_flags.c
*** ../src.P09/gas/testsuite/gas/mips/elf_e_flags.c Thu Jun 10 14:14:59 1999
--- ./gas/testsuite/gas/mips/elf_e_flags.c Wed Oct 18 14:39:35 2000
***************
*** 13,20 ****
Ian 10 June 1999: I tweaked the resulting assembler file so that it
would generate the same code when gas was configured for mips-elf
! and for mips64-elf. */
int
foo (int a, int b)
{
--- 13,26 ----
Ian 10 June 1999: I tweaked the resulting assembler file so that it
would generate the same code when gas was configured for mips-elf
! and for mips64-elf.
+ 18 October 2000: Chris Demetriou <cgd@sibyte.com> tweaked the code so
+ that it would always generate enough zero-padding at the end to make
+ objdump print "...", so that the test would be successful even on
+ machines that pad results to cache line or other boundaries
+ (e.g. mips-linux). */
+
int
foo (int a, int b)
{
diff -rc ../src.P09/gas/testsuite/gas/mips/elf_e_flags.s ./gas/testsuite/gas/mips/elf_e_flags.s
*** ../src.P09/gas/testsuite/gas/mips/elf_e_flags.s Thu Jun 10 14:15:00 1999
--- ./gas/testsuite/gas/mips/elf_e_flags.s Wed Oct 18 14:40:18 2000
***************
*** 41,43 ****
--- 41,46 ----
.set reorder
.end main
+
+ # Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .space 8
diff -rc ../src.P09/gas/testsuite/gas/mips/elf_e_flags1.d ./gas/testsuite/gas/mips/elf_e_flags1.d
*** ../src.P09/gas/testsuite/gas/mips/elf_e_flags1.d Wed Oct 6 19:57:33 1999
--- ./gas/testsuite/gas/mips/elf_e_flags1.d Wed Oct 18 14:35:55 2000
***************
*** 3,9 ****
# objdump: -fd
.*:.*file format.*mips.*
! architecture: mips:[34][0-9]00, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x0000000000000000
--- 3,9 ----
# objdump: -fd
.*:.*file format.*mips.*
! architecture: mips:.*, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x0000000000000000
***************
*** 25,27 ****
--- 25,28 ----
28: 00000000 nop
2c: 03e00008 jr \$ra
30: 27bd0028 addiu \$sp,\$sp,40
+ ...
diff -rc ../src.P09/gas/testsuite/gas/mips/elf_e_flags2.d ./gas/testsuite/gas/mips/elf_e_flags2.d
*** ../src.P09/gas/testsuite/gas/mips/elf_e_flags2.d Thu Jun 10 14:15:02 1999
--- ./gas/testsuite/gas/mips/elf_e_flags2.d Wed Oct 18 14:34:33 2000
***************
*** 25,27 ****
--- 25,28 ----
24: 00000000 nop
28: 03e00008 jr \$ra
2c: 27bd0028 addiu \$sp,\$sp,40
+ ...
diff -rc ../src.P09/gas/testsuite/gas/mips/elf_e_flags3.d ./gas/testsuite/gas/mips/elf_e_flags3.d
*** ../src.P09/gas/testsuite/gas/mips/elf_e_flags3.d Thu Jun 10 14:15:03 1999
--- ./gas/testsuite/gas/mips/elf_e_flags3.d Wed Oct 18 14:34:38 2000
***************
*** 25,27 ****
--- 25,28 ----
24: 00000000 nop
28: 03e00008 jr \$ra
2c: 27bd0028 addiu \$sp,\$sp,40
+ ...
diff -rc ../src.P09/gas/testsuite/gas/mips/elf_e_flags4.d ./gas/testsuite/gas/mips/elf_e_flags4.d
*** ../src.P09/gas/testsuite/gas/mips/elf_e_flags4.d Thu Jun 10 14:15:04 1999
--- ./gas/testsuite/gas/mips/elf_e_flags4.d Wed Oct 18 14:34:41 2000
***************
*** 25,27 ****
--- 25,28 ----
24: 00000000 nop
28: 03e00008 jr \$ra
2c: 27bd0028 addiu \$sp,\$sp,40
+ ...
diff -rc ../src.P09/gas/testsuite/gas/mips/la-svr4pic.d ./gas/testsuite/gas/mips/la-svr4pic.d
*** ../src.P09/gas/testsuite/gas/mips/la-svr4pic.d Mon Nov 15 07:47:48 1999
--- ./gas/testsuite/gas/mips/la-svr4pic.d Wed Oct 18 14:31:47 2000
***************
*** 469,471 ****
--- 469,472 ----
[ ]*[0-9a-f]+: R_MIPS_LO16 .bss
[0-9a-f]+ <[^>]*> addu \$a0,\$a0,\$at
[0-9a-f]+ <[^>]*> addu \$a0,\$a0,\$a1
+ ...
diff -rc ../src.P09/gas/testsuite/gas/mips/la-xgot.d ./gas/testsuite/gas/mips/la-xgot.d
*** ../src.P09/gas/testsuite/gas/mips/la-xgot.d Mon Nov 15 07:47:48 1999
--- ./gas/testsuite/gas/mips/la-xgot.d Wed Oct 18 14:30:27 2000
***************
*** 613,615 ****
--- 613,616 ----
[ ]*[0-9a-f]+: R_MIPS_LO16 .bss
[0-9a-f]+ <[^>]*> addu \$a0,\$a0,\$at
[0-9a-f]+ <[^>]*> addu \$a0,\$a0,\$a1
+ ...
diff -rc ../src.P09/gas/testsuite/gas/mips/la.s ./gas/testsuite/gas/mips/la.s
*** ../src.P09/gas/testsuite/gas/mips/la.s Mon May 3 00:28:51 1999
--- ./gas/testsuite/gas/mips/la.s Wed Oct 18 14:31:36 2000
***************
*** 107,114 ****
la $4,big_local_common+0x1a5a5($5)
la $4,small_local_common+0x1a5a5($5)
! .ifndef KPIC
! # Round to a 16 byte boundary, for ease in testing multiple targets.
! nop
! nop
! .endif
--- 107,111 ----
la $4,big_local_common+0x1a5a5($5)
la $4,small_local_common+0x1a5a5($5)
! # Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
! .space 8
diff -rc ../src.P09/gas/testsuite/gas/mips/sync.d ./gas/testsuite/gas/mips/sync.d
*** ../src.P09/gas/testsuite/gas/mips/sync.d Thu Jun 10 14:15:05 1999
--- ./gas/testsuite/gas/mips/sync.d Wed Oct 18 14:29:59 2000
***************
*** 8,10 ****
--- 8,11 ----
0+0000 <foo> 0000000f[ ]*sync
0+0004 <foo\+0x4> 0000040f[ ]*sync.p
0+0008 <foo\+0x8> 0000000f[ ]*sync
+ ...
diff -rc ../src.P09/gas/testsuite/gas/mips/sync.s ./gas/testsuite/gas/mips/sync.s
*** ../src.P09/gas/testsuite/gas/mips/sync.s Mon May 3 00:28:51 1999
--- ./gas/testsuite/gas/mips/sync.s Wed Oct 18 14:29:54 2000
***************
*** 3,5 ****
--- 3,8 ----
sync
sync.p
sync.l
+
+ # Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .space 8