Related articles |
---|
*nix dynamic linking on a different target (cross) marcov@stack.nl (Marco van de Voort) (2003-10-18) |
From: | Marco van de Voort <marcov@stack.nl> |
Newsgroups: | comp.compilers |
Date: | 18 Oct 2003 15:59:54 -0400 |
Organization: | Eindhoven University of Technology, The Netherlands |
Keywords: | linker, question, comment |
Posted-Date: | 18 Oct 2003 15:59:54 EDT |
This is more a question about the principles of dynamic linking on
Unix, but since linkers are on topic here, I guess it is ok.
I want to generate (non-gcc, but with the GNU linker) daily snapshots
for a projecttargeted at multiple OSes, versions and distributions,
preferably dynamically linked.
So the question is pretty much: "Can you crosslink binaries that use shared
libraries for other platforms using GNU ld, and if yes, what are the base
principles"
Of course I'll need a directory of shared libraries on my master system,
but that is not the problem.
The thing that made me doubt if it is possible is that when I create
dyn-libs locally (not cross) I see that the GNU linker gets an shared
lib so passed as "dynlinker". So probably this means I need "cross"
versions of this dynlinker shared library too (if they even exist),
and must find a way to harness these so that they look into the proper
directories only.
[If you're building ELF executables, the linker creates an "interpreter"
section with the name of the dynamic linker, usually /lib/ld.so or something
like that. The system program loader maps in the progam, maps in the
interpreter, and starts the interpreter which then looks in the executable
to find the other libraries. The linker needs access to a copy of the
interpreter, but ld.so is just another shared executable. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.