This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Something different with elf64-x86-64 format?
- From: Ian Lance Taylor <iant at google dot com>
- To: etienne_lorrain at yahoo dot fr
- Cc: binutils at sourceware dot org
- Date: Fri, 03 Apr 2009 07:51:52 -0700
- Subject: Re: Something different with elf64-x86-64 format?
- References: <322799.52832.qm@web23607.mail.ird.yahoo.com>
Etienne Lorrain <etienne_lorrain@yahoo.fr> writes:
> I find the correct header at 0, and at offset 0x20 I see
> e_phoff: "Program header offset" so I get the program header
> at 0x40.
> At 0x40, I have p_type "Type of segment" i.e. PT_LOAD,
> at 0x44 I have p_flags "Segment attributes" 0x05 (RX),
> but at 0x48 I should have a 64 bits number p_offset
> "Offset in file" and it is zero... unlike what objdump tells.
objdump is dumping the section headers. You are looking at the segment
headers.
When examining ELF files at this level of detail, you should always use
readelf, not objdump. objdump translates from ELF into a generic
format, and then dumps the generic format. readelf dumps the ELF file
directly. In this case, you want to look at the output of readelf -l.
Ian