This is the mail archive of the binutils@sourceware.cygnus.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]

Re: adding rpath to existing executable


On Sun, Jun 20, 1999 at 10:38:28PM +0100, Kasper Peeters wrote:
> Is there a _complicated_ way to add an RPATH to an already existing
> executable using binutils? 

I don't think so.

> But I find it hard to believe that
> nobody else has had a need for such a program before. 

I've seen such a program before, but it was written to directly
manipulate the ELF file structures.

> Is libbfd capable of doing this or is more trickery involved that I am
> not aware of?

There has to be room in one of the existing loadable segments
(usually at the end of the readonly segment containing .text),
and if there isn't, you have to add a new loadable segment
somewhere in the address space.  This can also mean shifting the
loadable segments around in the executable image to make room.

The general case is exceedingly ugly.


r~

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