get_section_by_name in libbfd

vamsi krishna
Mon Oct 16 17:22:00 GMT 2006


You might want to see how 'readelf --segments' is giving out the
segment to section mappings.

Actually the segment to section mapping for a executable is predefined
while creating the executable itsself. The segment information is the
Program Headers (Elf_Phdrs) for a elf executable. The text is of type
PT_LOAD with permissions 'R-E' (read and execute)

Vamsi kundeti
On 10/14/06, Sandeep Kumar <> wrote:
> Hi,
> Is it possible to  get all the names of all the sections which will
> get mapped into the text segment at runtime, using libbfd.
> I tried using get_section_by_name, but in this case i dont know all
> the names of the section which will get mapped into the text segment.
> ".text" is by deafult, but there can be many more   like ,
> .text.likely , .text.unlikely, etc.
> --
> Regards,
> Sandeep
> Winners expect to win in advance. Life is a self-fulfilling prophecy.

More information about the Binutils mailing list