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

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;
        return i;
$ gcc a.c
$ objcopy -O elf32-i386 a.exe
$ objcopy -O pei-i386 a.exe
$ objdump -x a.exe
a.exe:     file format pei-i386
architecture: i386, flags 0x00000132:
start address 0x00401000

Characteristics 0x307
        relocations stripped
        line numbers stripped
        32 bit words
        debugging information removed

Time/Date               Wed May 25 06:43:15 2005

ImageBase               00000000
SectionAlignment        00000000
FileAlignment           00000000
MajorOSystemVersion     0
MinorOSystemVersion     0
MajorImageVersion       0
MinorImageVersion       0
MajorSubsystemVersion   0
MinorSubsystemVersion   0
Win32Version            00000000
SizeOfImage             00000000
SizeOfHeaders           00000400
CheckSum                00010ed7
Subsystem               00000000        (unspecified)
DllCharacteristics      00000000
SizeOfStackReserve      00000000
SizeOfStackCommit       00000000
SizeOfHeapReserve       00000000
SizeOfHeapCommit        00000000
LoaderFlags             00000000
NumberOfRvaAndSizes     00000010

The Data Directory
Entry 0 00000000 00000000 Export Directory [.edata (or where ever we found it)]
Entry 1 00405000 000001f0 Import Directory [parts of .idata]
Entry 2 00000000 00000000 Resource Directory [.rsrc]
Entry 3 00000000 00000000 Exception Directory [.pdata]
Entry 4 00000000 00000000 Security Directory
Entry 5 00000000 00000000 Base Relocation Directory [.reloc]
Entry 6 00000000 00000000 Debug Directory
Entry 7 00000000 00000000 Description Directory
Entry 8 00000000 00000000 Special Directory
Entry 9 00000000 00000000 Thread Storage Directory [.tls]
Entry a 00000000 00000000 Load Configuration Directory
Entry b 00000000 00000000 Bound Import Directory
Entry c 00000000 00000000 Import Address Table Directory
Entry d 00000000 00000000 Delay Import Directory
Entry e 00000000 00000000 Reserved
Entry f 00000000 00000000 Reserved

There is an import table in .idata at 0x405000

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. 

(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?)


Unsubscribe info:
Problem reports:

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