This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: modifying rpaths on executables
- From: Ian Lance Taylor <ian at airs dot com>
- To: Jeremy Sanders <jss at ast dot cam dot ac dot uk>
- Cc: binutils at sources dot redhat dot com
- Date: 22 Aug 2003 09:24:32 -0700
- Subject: Re: modifying rpaths on executables
- References: <Pine.LNX.4.56.0308221103250.23647@xpc5.ast.cam.ac.uk>
Jeremy Sanders <jss@ast.cam.ac.uk> writes:
> The best solution would be to stick in an rpath into each executable to
> avoid having to set LD_LIBRARY_PATH. Is there an obvious way in which to
> do this?
No.
> Would I have any hope in writing code to do this unless I have a
> good understanding of the elf format?
No.
You have to squeeze in the new string and the new dynamic table entry
without disturbing the page alignment of the loadable segments. This
probably means that you have to add a full page to the executable
somewhere, and move the dynamic table and strings to that new page.
This will make running the executable a tiny bit slower, but you
probably don't care about that under the circumstances.
Ian