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]

Re: marking executables with LD_LIBRARY_PATH


"Marty Leisner" <mleisner@eng.mc.xerox.com> writes:

> I did something like:
> 1 :mleisner@valisk; ld -o gs.new2 gs-test --rpath ~/marty/lib/
> 
> That's really all I wanted to do...(I tried -rpath and --rpath).

Oh.  No, that won't work.

> Seems to me it should be reasonable for the linker to read in an 
> executable and write out an executable (or some other simple program).

I guess I disagree.  The linker reads object files and outputs
executables and shared libraries.  It doesn't read executables.  (It
may appear to read shared libraries, but actually it just reads the
dynamic symbol table.)

All the interesting things which the linker does center around
processing relocation information.  There is no relocation information
in an executable.

The tool for this job would be objcopy.  Unfortunately, objcopy can't
modify the loadable segments of a fully linked executable or shared
library.  In the general case, nothing can.

Ian

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