This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: to exec a shared object
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Ian Lance Taylor <ian at wasabisystems dot com>
- Cc: binutils at sources dot redhat dot com,Henry Thor Baldursson <henry at f-prot dot com>
- Date: Wed, 12 May 2004 03:33:23 +0200
- Subject: Re: to exec a shared object
- References: <1084196124.2924.154.camel@henry.frisk-software.com> <m3zn8gkxys.fsf@gossamer.airs.com> <1084284362.2924.229.camel@henry.frisk-software.com> <m3zn8f82hs.fsf@gossamer.airs.com>
[GCC list culled]
Yes, because GNU/Linux is willing and able to execute shared
libraries, I believe it is correct for the linker to define an entry
point by default.
The linker just goes and takes the start of the text segment
as the entry point (unless there is a _start symbol)... quite
wrong in most cases. A better default would be to make no
entry point, imho. So maybe add
test -z "$ENTRY" && test -n "$CREATE_SHLIB" && ENTRY=0
or something like it to the start of elf.sc and friends? No idea
if this will really work, though ;-)
Oh, and maybe the Linux kernel needs some work, too, to give the
proper diagnostics.
[I have no time or resources to actually create and test a full
patch right now, sorry].
Segher