This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Forced creation of dynamic sections
- From: Nick Clifton <nickc at redhat dot com>
- To: Stephen Clarke <stephen dot clarke at st dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 18 Nov 2003 14:45:18 +0000
- Subject: Re: Forced creation of dynamic sections
- References: <3FB3E67C.EC130126@st.com>
Hi Stephen,
> Is there a way to force ld to create the dynamic sections,
> even if there are no dynamic objects in the link?
>
> I'm building a static main program that has a run-time loader
> (a cut down dlopen()-like thing) built into it. My
> loader wants to load a module that contains some undefined
> references, and resolve those to symbols in the main
> program. To do this I need to ensure the main program
> contains a dynamic symbol table.
>
> I guess I can use tricks with a dummy reference to a dummy
> dynamic library to do this, but is there a better way?
Not really. You are trying to play tricks with the operating system
and this is never a very good idea.
You might try using the --emit-relocs linker option, although I am not
guaranteeing anything.
Cheers
Nick