This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld and relocatable vs. absolute
- To: chuckmeade at yahoo dot com
- Subject: Re: ld and relocatable vs. absolute
- From: Geoff Keating <geoffk at cygnus dot com>
- Date: Fri, 8 Sep 2000 14:37:21 -0700
- CC: binutils at sourceware dot cygnus dot com
- References: <NEBBIDBEELLFOALBLBEKCEAMCCAA.chuckmeade@yahoo.com>
> 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>