This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: Problem with elf header


Hi Sandeep,

Can anyone just tell me that why after reading the elf headers of the
applications like gzip, bunzip2 on the x86 machines , the program
entry point along with all other entries are zeros.

I am trying to access the header with this piece of code,
Its working fine for most of the executables but for the few above
mentioned application, its returning zero.

  Elf32_Ehdr* self = (Elf32_Ehdr *)0x8048000;
    ptr=(int *)self->e_entry;

Why are you assuming that the header will always be at address 0x80480000 ? Perhaps for the applications you mention it is at some other address ?


Cheers
  Nick


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