This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: get_section_by_name in libbfd
- From: "vamsi krishna" <vamsi dot krishnak at gmail dot com>
- To: "Sandeep Kumar" <sandeepksinha at gmail dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 14 Oct 2006 14:46:01 -0400
- Subject: Re: get_section_by_name in libbfd
- References: <37d33d830610141057g72aa1ecasc4e8021d9ff4e069@mail.gmail.com>
Hi,
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)
HTH
Vamsi kundeti
On 10/14/06, Sandeep Kumar <sandeepksinha@gmail.com> 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.hot ,
.text.likely , .text.unlikely, etc.
--
Regards,
Sandeep
Winners expect to win in advance. Life is a self-fulfilling prophecy.