ld and relocatable vs. absolute
Geoff Keating
geoffk@cygnus.com
Fri Sep 8 14:45:00 GMT 2000
> From: "Chuck Meade" <chuckmeade@yahoo.com>
> Date: Fri, 8 Sep 2000 16:20:36 -0400
> Several linkers (including Diab and Green Hills) support the
> creation of a fully-linked executable image that at the same
> time retains relocation information, allowing it to be
> relocated to a dynamically determined memory address at load
> time by an on-target loader.
>
> Such an image would not have unresolved references, it would
> just be relocatable.
>
> I would like to be able to accomplish the same with ld for
> PowerPC. Has anyone out there done this? Any tips?
Just use 'gcc -shared -Wl,-bdynamic'. This gives you an ELF-format
executable relocatable file with no external references (assuming
you did in fact define everything). By default it will expect to be
loaded at location 0, but you can change that with an appropriate
linker script.
--
- Geoffrey Keating <geoffk@cygnus.com>
More information about the Binutils
mailing list