How to access an applications ELF program header and ELF section header at runtime

Carlos O'Donell carlos@systemhalted.org
Wed Aug 19 12:39:00 GMT 2009


On Wed, Aug 19, 2009 at 12:37 AM, Bharath Ramesh<bramesh@vt.edu> wrote:
> Thanks for the reply, are these symbols __data_start, __bss_start specific
> to Linux or would they work under any GNU system running a different kernel.
> I am trying to keep my work portable to any system that uses GNU libc, but
> not particularly the Linux kernel.

There is no guarantee that these symbols exist, or that they will
remain the same in the next release.

In practice they are part of the standard Linux application linker
script, which uses the symbol to mark the start and end of .data and
.bss.

The .data and .bss sections are also not guaranteed to exist, and we
now support read-only data in the form of the .rodata section.

Good luck with your project.

Cheers,
Carlos.



More information about the Libc-help mailing list