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


On 2/17/06, Nick Clifton <nickc@redhat.com> wrote:
> 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
>

But sir this address varies from application to application, how can
we find a general way to get the program load address, is it present
somewhere in the elf header ?


--
Regards,
Sandeep





A man with one watch knows what time it is; a man with two watches is
never quite sure.


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