This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [ANNOUNCEMENT] Updated: binutils-20050520-1

----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.

Can't think of a witty .sigline today....

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]