Add RPATH/RUNPATH entry

Jörg Richter joerg.richter@pdv-fs.de
Wed Jul 15 10:15:00 GMT 2009


Hi,

My ultimate goal is to add an RPATH or RUNPATH entry to a shared library or 
executable. But without using the original object files.
I know about chrpath. But it doesn't match my needs. I also want to add 
RPATH if there was non before.

One might think that ld can do it somehow along the lines of:
  ld -shared -rpath DIR -o libA2.so libA.so

But this doesn't work as (I) expected. libA.so is only referenced as NEEDED 
but not copied. Can this even theoretical work?

My next guess is objcopy. But I found already that this was discussed before 
and it is not (yet) possible. 

Now I'm thinking about adding this functionality to objcopy. Do you think this
is the right tool to do it?

   Jörg




More information about the Binutils mailing list