delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/05/25/10:14:53

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: [ANNOUNCEMENT] Updated: binutils-20050520-1
Date: Wed, 25 May 2005 15:14:29 +0100
MIME-Version: 1.0
In-Reply-To: <ba40711f050525035423005994@mail.gmail.com>
Message-ID: <SERRANO25q8awYFDIfW00000138@SERRANO.CAM.ARTIMI.COM>
X-OriginalArrivalTime: 25 May 2005 14:14:28.0649 (UTC) FILETIME=[101D8190:01C56134]

----Original Message----
>From: Lev Bishop
>Sent: 25 May 2005 11:54

> I don't have much clue what I'm doing with binutils, but I've managed
> to cause a SEGV in objdump. Here's how:
> $ cat > a.c
> int main (void)
> {
>         int i=1;
>         i++;
>         return i;
> }
> $ gcc a.c
> $ objcopy -O elf32-i386 a.exe
> $ objcopy -O pei-i386 a.exe

  Yow.  So you copy it from a PE to an ELF, and then back to PE?  You very
much need to read the section on canonicalisation in the bfd section of the
ld manual.  "info ld" then search for "BFD information loss".

> The Import Tables (interpreted .idata section contents)
>  vma:            Hint    Time      Forward  DLL       First
>                  Table   Stamp     Chain    Name      Thunk
>  00405000       00005040 00000000 00000000 000051c4 00005088
> Segmentation fault (core dumped)
> 
> This happens with the new binutils and also the previous version.

  Yup, so something vital didn't get carried over to the ELF format, or
didn't get converted back.  To be expected really.
 
> (What I was actually hoping to do above was to remove/normalize the
> time/date header in pei-i386, so that my executables are repeatable
> functions of their sources, so I can checksum/fingerprint them in my
> build system. Clearly my above attempts failed, so does anybody know
> of a way to acheive this?)

  Yes, take look at the way gcc's bootstrap procedure compares files to make
sure they have the exact same contents, without being fooled by the
timestamp: it uses the 'cmp' command, with the --ignore-initial= option set
to about 16 or so to ignore the varying timestamp in the file header.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019