GNU ld linker wrapping
Alan Modra
amodra@bigpond.net.au
Mon Jun 5 03:29:00 GMT 2006
More information about the Binutils mailing list
Mon Jun 5 03:29:00 GMT 2006
- Previous message (by thread): GNU ld linker wrapping
- Next message (by thread): Patch to fix some PDF manual builds
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Jun 02, 2006 at 04:33:49PM -0500, Shawn Yarbrough wrote: > The third-party 3.2.2 library uses the older, version 5, C++ standard > library that was normal for g++ 3.2.2. My code uses version 6. How > would I tell the linker to use version 5 only for linking the > third-party library, and use version 6 for linking everything else in > my app? For shared libraries without versioned symbols, I think you are out of luck. The linker can't help you as the libs are already finally linked, so there isn't any possibility of "wrapping" them as you imagine. Instead, you need some magic in the dynamic linker, ld.so. Modifying ld.so symbol resolution would be possible, but you likely won't find much help, at least for free, if you attempt this. Failing that, you'd need to edit dynamic symbols so that references in the proprietary lib are changed to only be satisfied by a similarly changed old libstdc++. Note that objcopy doesn't allow renaming of dynamic syms, one reason being that the sections describing dyamic symbols are loadable and thus can't increase in size without affecting other loaded sections. You'd also need to adjust symbol hashes. For static libs, you might be able to do something with ld -r. Link the proprietary static lib against the static version of the old libstdc++. Then use objcopy to remove all the syms you don't want. The resulting .o might then be usable, but I suspect there will be some horrible details that will bite you. Frankly, I wouldn't try any of this myself. You would be better off using the same old version of g++ as that used to compile the proprietary libs, or pressing your vendor for new libs. -- Alan Modra IBM OzLabs - Linux Technology Centre
- Previous message (by thread): GNU ld linker wrapping
- Next message (by thread): Patch to fix some PDF manual builds
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list