This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ld and relocatable vs. absolute


> 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>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]