This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: modifying rpaths on executables


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]