<div dir="ltr">On Tue, Sep 23, 2008 at 7:58 AM, Ville Laurikari <span dir="ltr"><<a href="mailto:ville@laurikari.net">ville@laurikari.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It took me quite a while to figure out how to do it on HP-UX (it did<br>
turn out to be quite simple, though). It works at least for<br>
standalone executables, but I have no idea about shared libraries.</blockquote><div><br>The problem with shared libraries is that etext will be the main program's text segment. I don't know about __text_start, but _start and _init also will refer to the main program. The only way I know of is to find the ELF headers and try to parse them. Of course, I don't know how to find the loaded ELF header either. Ironically, windows is the only platform that will currently work, as __image_base__ refers to the loaded start of the current DSO on win32.<br>
<br></div></div></div>