WIP MachO binutils port assisted by AI I may consider upstreaming this in the future.
0

Configure Feed

Select the types of activity you want to include in your feed.

binutils/testsuite/

2005-10-19 H.J. Lu <hongjiu.lu@intel.com>

PR binutils/1487
* binutils-all/objcopy.exp (objcopy_test): New procedure.
Use it to test simple copy, ia64 link order and ELF unknown
section type.

* binutils-all/unknown.s: New file.

ld/testsuite/

2005-10-19 H.J. Lu <hongjiu.lu@intel.com>

PR binutils/1487
* ld-elf/unknown.d: New file.

H.J. Lu (Oct 19, 2005, 8:49 PM UTC) 64bb95af 29024861

+85 -83
+9
binutils/testsuite/ChangeLog
··· 1 1 2005-10-19 H.J. Lu <hongjiu.lu@intel.com> 2 2 3 + PR binutils/1487 4 + * binutils-all/objcopy.exp (objcopy_test): New procedure. 5 + Use it to test simple copy, ia64 link order and ELF unknown 6 + section type. 7 + 8 + * binutils-all/unknown.s: New file. 9 + 10 + 2005-10-19 H.J. Lu <hongjiu.lu@intel.com> 11 + 3 12 PR binutils/1321 4 13 * binutils-all/link-order.s: New. 5 14
+5
ld/testsuite/ChangeLog
··· 1 1 2005-10-19 H.J. Lu <hongjiu.lu@intel.com> 2 2 3 + PR binutils/1487 4 + * ld-elf/unknown.d: New file. 5 + 6 + 2005-10-19 H.J. Lu <hongjiu.lu@intel.com> 7 + 3 8 * ld-ia64/ia64.exp: Check link order for ld -r. 4 9 5 10 2005-10-18 Alan Modra <amodra@bigpond.net.au>
+67 -83
binutils/testsuite/binutils-all/objcopy.exp
··· 30 30 31 31 send_user "Version [binutil_version $OBJCOPY]" 32 32 33 - if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then { 34 - perror "unresolved 1" 35 - unresolved "objcopy (simple copy)" 36 - return 37 - } 38 - 39 33 if ![is_remote host] { 40 34 set tempfile tmpdir/bintest.o 41 35 set copyfile tmpdir/copy ··· 46 40 47 41 # Test that objcopy does not modify a file when copying it. 48 42 49 - set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS $tempfile ${copyfile}.o"] 43 + proc objcopy_test {testname srcfile} { 44 + global OBJCOPY 45 + global OBJCOPYFLAGS 46 + global srcdir 47 + global subdir 48 + global tempfile 49 + global copyfile 50 50 51 - if ![string match "" $got] then { 52 - fail "objcopy (simple copy)" 53 - } else { 54 - send_log "cmp $tempfile ${copyfile}.o\n" 55 - verbose "cmp $tempfile ${copyfile}.o" 56 - if [is_remote host] { 57 - set src1 tmpdir/bintest.o 58 - set src2 tmpdir/copy.o 59 - remote_upload host $tempfile $src1 60 - remote_upload host ${copyfile}.o $src2 61 - } else { 62 - set src1 ${tempfile} 63 - set src2 ${copyfile}.o 51 + if {![binutils_assemble $srcdir/$subdir/${srcfile} tmpdir/bintest.o]} then { 52 + perror "unresolved $testname" 53 + unresolved "objcopy ($testname)" 54 + return 64 55 } 65 - set status [remote_exec build cmp "${src1} ${src2}"] 66 - set exec_output [lindex $status 1] 67 - set exec_output [prune_warnings $exec_output] 68 56 69 - # On some systems the result of objcopy will not be identical. 70 - # Usually this is just because gas isn't using bfd to write the files 71 - # in the first place, and may order things a little differently. 72 - # Those systems should use setup_xfail here. 57 + set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS $tempfile ${copyfile}.o"] 73 58 74 - setup_xfail "h8300-*-rtems*" "h8300-*-coff" 75 - setup_xfail "h8500-*-rtems*" "h8500-*-coff" 76 - setup_xfail "hppa*-*-*" 77 - setup_xfail "i960-*" 78 - setup_xfail "m68*-*-*coff" "m68*-*-hpux*" "m68*-*-lynxos*" 79 - setup_xfail "m68*-*-sysv*" "m68*-apple-aux*" 80 - setup_xfail "m8*-*" 81 - setup_xfail "or32-*-rtems*" "or32-*-coff" 82 - setup_xfail "sh-*-coff*" "sh-*-rtems*" 83 - setup_xfail "tic4x-*-*" "tic80-*-*" "w65-*" 84 - 85 - clear_xfail "hppa*64*-*-hpux*" "hppa*-*-linux*" "hppa*-*-lites*" 86 - clear_xfail "hppa*-*-*n*bsd*" "hppa*-*-rtems*" "*-*-*elf*" "m68*-*-sysv4*" 87 - 88 - if [string match "" $exec_output] then { 89 - pass "objcopy (simple copy)" 59 + if ![string match "" $got] then { 60 + fail "objcopy ($testname)" 90 61 } else { 91 - send_log "$exec_output\n" 92 - verbose "$exec_output" 1 62 + send_log "cmp $tempfile ${copyfile}.o\n" 63 + verbose "cmp $tempfile ${copyfile}.o" 64 + if [is_remote host] { 65 + set src1 tmpdir/bintest.o 66 + set src2 tmpdir/copy.o 67 + remote_upload host $tempfile $src1 68 + remote_upload host ${copyfile}.o $src2 69 + } else { 70 + set src1 ${tempfile} 71 + set src2 ${copyfile}.o 72 + } 73 + set status [remote_exec build cmp "${src1} ${src2}"] 74 + set exec_output [lindex $status 1] 75 + set exec_output [prune_warnings $exec_output] 93 76 94 - # On OSF/1, this succeeds with gas and fails with /bin/as. 95 - setup_xfail "alpha*-*-osf*" 77 + # On some systems the result of objcopy will not be identical. 78 + # Usually this is just because gas isn't using bfd to write the 79 + # files in the first place, and may order things a little 80 + # differently. Those systems should use setup_xfail here. 96 81 97 - # This fails for COFF i960-vxworks targets. 98 - setup_xfail "i960-*-vxworks*" 82 + setup_xfail "h8300-*-rtems*" "h8300-*-coff" 83 + setup_xfail "h8500-*-rtems*" "h8500-*-coff" 84 + setup_xfail "hppa*-*-*" 85 + setup_xfail "i960-*" 86 + setup_xfail "m68*-*-*coff" "m68*-*-hpux*" "m68*-*-lynxos*" 87 + setup_xfail "m68*-*-sysv*" "m68*-apple-aux*" 88 + setup_xfail "m8*-*" 89 + setup_xfail "or32-*-rtems*" "or32-*-coff" 90 + setup_xfail "sh-*-coff*" "sh-*-rtems*" 91 + setup_xfail "tic4x-*-*" "tic80-*-*" "w65-*" 99 92 100 - fail "objcopy (simple copy)" 93 + clear_xfail "hppa*64*-*-hpux*" "hppa*-*-linux*" "hppa*-*-lites*" 94 + clear_xfail "hppa*-*-*n*bsd*" "hppa*-*-rtems*" "*-*-*elf*" 95 + clear_xfail "m68*-*-sysv4*" 96 + 97 + if [string match "" $exec_output] then { 98 + pass "objcopy ($testname)" 99 + } else { 100 + send_log "$exec_output\n" 101 + verbose "$exec_output" 1 102 + 103 + # On OSF/1, this succeeds with gas and fails with /bin/as. 104 + setup_xfail "alpha*-*-osf*" 105 + 106 + # This fails for COFF i960-vxworks targets. 107 + setup_xfail "i960-*-vxworks*" 108 + 109 + fail "objcopy ($testname)" 110 + } 101 111 } 102 112 } 113 + 114 + objcopy_test "simple copy" bintest.s 103 115 104 116 # Test generating S records. 105 117 ··· 652 664 # ia64 specific tests 653 665 if { ([istarget "ia64-*-elf*"] 654 666 || [istarget "ia64-*-linux*"]) } { 655 - if {![binutils_assemble $srcdir/$subdir/link-order.s tmpdir/bintest.o]} then { 656 - perror "unresolved ia64 link order." 657 - unresolved "objcopy (ia64 link order)" 658 - } else { 659 - # Test that objcopy does not modify a file with link order bit 660 - # when copying it. 667 + objcopy_test "ia64 link order" link-order.s 668 + } 661 669 662 - set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS $tempfile ${copyfile}.o"] 663 - 664 - if ![string match "" $got] then { 665 - fail "objcopy (ia64 link order)" 666 - } else { 667 - send_log "cmp $tempfile ${copyfile}.o\n" 668 - verbose "cmp $tempfile ${copyfile}.o" 669 - if [is_remote host] { 670 - set src1 tmpdir/bintest.o 671 - set src2 tmpdir/copy.o 672 - remote_upload host $tempfile $src1 673 - remote_upload host ${copyfile}.o $src2 674 - } else { 675 - set src1 ${tempfile} 676 - set src2 ${copyfile}.o 677 - } 678 - set status [remote_exec build cmp "${src1} ${src2}"] 679 - set exec_output [lindex $status 1] 680 - set exec_output [prune_warnings $exec_output] 681 - 682 - if [string match "" $exec_output] then { 683 - pass "objcopy (ia64 link order)" 684 - } else { 685 - fail "objcopy (ia64 link order)" 686 - } 687 - } 688 - } 670 + # ELF specific tests 671 + if [is_elf_format] { 672 + objcopy_test "ELF unknown section type" unknown.s 689 673 }
+4
binutils/testsuite/binutils-all/unknown.s
··· 1 + .section .foo,"a","note" 2 + .global _start 3 + _start: 4 + .long 0