delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/05/25/06:54:50

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
Message-ID: <ba40711f050525035423005994@mail.gmail.com>
Date: Wed, 25 May 2005 06:54:28 -0400
From: Lev Bishop <lev DOT bishop AT gmail DOT com>
Reply-To: Lev Bishop <lev DOT bishop AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [ANNOUNCEMENT] Updated: binutils-20050520-1
In-Reply-To: <20050525054017.8BCDE544122@calimero.vinschen.de>
Mime-Version: 1.0
References: <20050525054017 DOT 8BCDE544122 AT calimero DOT vinschen DOT de>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j4PAskda012715

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
$ objdump -x a.exe
a.exe:     file format pei-i386
a.exe
architecture: i386, flags 0x00000132:
EXEC_P, HAS_SYMS, HAS_LOCALS, D_PAGED
start address 0x00401000

Characteristics 0x307
        relocations stripped
        executable
        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?)

Lev

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