[hellogcc] Re: programme header

  • From: 杨勇勇 <triple.yang@xxxxxxxxx>
  • To: hellogcc@xxxxxxxxxxxxx
  • Date: Sun, 17 Mar 2013 23:47:32 +0800

2013/3/17 ishare <june.tune.sea@xxxxxxxxx>:
>
>   In an ELF ,does the programme header locate at address fronter than section 
> header?

Not necessary. Theoretically, program header can be placed anywhere in
a elf file. Its address is saved
in elf header. We can check the address of program header and then get
our access to its contents. And so does
section header.

>
>   Do I need to set a specified value to locate programme header? How to ?

What do you mean by "set a specified value"?
If you are using an elf library, I bet there is some API which helps
you to locate program header. Go and find it.

Otherwise, you might be implementing an elf lib or even a linker, I
guess there is some algorithm to determine where
program header should be placed. In this case, neither should you "set
a specified value“ directly.

>
>   when would  the linker  report " Not enough room for program headers" error 
> ?

Since there is not any rules in elf specs, I think it probably depends
on linker implementation.

>
>   thanks!
>
>

Regards.

-- 
杨勇勇 (Yang Yong-Yong)

Other related posts: