This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: timestamp in coff header breaks ld testsuite
Hi Ian,
> I don't like this patch, as it completely fails to check whether the
> bytes at the start of the file are the same. Those bytes are
> important in pretty much any object file format, and any differences
> in them matter.
Ok - how about this variation? It tests to see if the target is a PE
target and only performs the truncation for those targets. This
should work until such time as a tool is written to strip the date out
of the executable.
Cheers
Nick
2001-11-13 Nick Clifton <nickc@cambridge.redhat.com>
* ld-bootstrap/bootstrap.exp: Only scan tail of executable for
PE targets.
Index: ld/testsuite/ld-bootstrap/bootstrap.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-bootstrap/bootstrap.exp,v
retrieving revision 1.7
diff -p -c -r1.7 bootstrap.exp
*** bootstrap.exp 2001/11/12 16:26:17 1.7
--- bootstrap.exp 2001/11/13 10:55:56
*************** foreach flags {"" "strip" "--static" "--
*** 129,143 ****
send_log "compare (tail of) tmpdir/ld2 tmpdir/ld3\n"
verbose "compare (tail of) tmpdir/ld2 tmpdir/ld3"
! # Trim off the date present in PE binaries by only looking
! # at the ends of the files
! # Although this works, a way to set the date would be better.
! # Removing or zeroing the date stamp in the binary produced by
! # the linker is not possible as it is required by the target OS.
! exec tail +140 tmpdir/ld2 >tmpdir/ld2tail
! exec tail +140 tmpdir/ld3 >tmpdir/ld3tail
! catch "exec cmp tmpdir/ld2tail tmpdir/ld3tail" exec_output
! exec rm tmpdir/ld2tail tmpdir/ld3tail
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] then {
--- 129,150 ----
send_log "compare (tail of) tmpdir/ld2 tmpdir/ld3\n"
verbose "compare (tail of) tmpdir/ld2 tmpdir/ld3"
! if {[istarget "*-*-pe"]
! || [istarget "*-*-wince"]} {
! # Trim off the date present in PE binaries by only looking
! # at the ends of the files
! # Although this works, a way to set the date would be better.
! # Removing or zeroing the date stamp in the binary produced by
! # the linker is not possible as it is required by the target OS.
! exec tail +140 tmpdir/ld2 >tmpdir/ld2tail
! exec tail +140 tmpdir/ld3 >tmpdir/ld3tail
! catch "exec cmp tmpdir/ld2tail tmpdir/ld3tail" exec_output
! exec rm tmpdir/ld2tail tmpdir/ld3tail
! } else {
! send_log "cmp tmpdir/ld2 tmpdir/ld3\n"
! verbose "cmp tmpdir/ld2 tmpdir/ld3"
! catch "exec cmp tmpdir/ld2 tmpdir/ld3" exec_output
! }
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] then {