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]
Other format: [Raw text]

Re: to exec a shared object


[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



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