From: David C. <cl...@au...> - 2004-08-17 01:05:45
|
At the risk of giving an over-simplified example: you can change the library search path in an executable that has already been created, as long as it hasn't been stripped. Basically, you just relink it with the -blibpath option to ld, specifying the runtime libpath that you want. In a basic example, you might have executable "foo" and use it to relink and create "foo2": $ ld -blibpath:/usr/lib:/lib:/usr/local/lib -lc foo -o foo2 So if "foo" didn't have /usr/local/lib in its library search path, "foo2" now does. Run "dump -Hv" on each executable to compare. This is overly basic, because I've only got "-lc" for libc.a and you wouldn't need /usr/local/lib for that, but it should show the basic idea. You'd add more "-lxxx" options as needed. On Mon, Aug 16, 2004 at 11:32:41PM +0200, Remco Post wrote: > .... > > I thought there was a way to edit the linking info in an executable, > unfortunately I haven't been able to find that info (or should I feed > ld more flags to make sure it doesn't put those paths in there in the > first place?) > -- David Clissold cl...@au... |