to exec a shared object

Henry Thor Baldursson henry@f-prot.com
Tue May 11 14:06:00 GMT 2004


On Mon, 2004-05-10 at 17:12, Ian Lance Taylor wrote: 
> You imply that your operating system is GNU/Linux.  GNU/Linux does
> permit executing shared libraries.  But as far as I know it does not
> require executing them.  If you don't like the results of executing a
> shared library, then don't execute it.

No, Linux doesn't _require_ you run shared libs. Except for ld.so, for
dynamic executables. That didn't answer my letter however, nor did that
banal diatribe about how constructors are implemented answer anything
either. The -entry option of the linker is more relevant than the -init
option here.

The issue I raised with much humility, mind you, was whether it was
proper behaviour of the linker to define an entrypoint when the
programmer never intended for there to be one. And for the sake of
argument whether it would not be better behaviour for the execve syscall
to return that unused ELIBEXEC macro on ET_DYN objects without
entrypoints. The current behaviour that the call results in a segfault
isn't very descriptive. Though I must admit, I am not sure why the
dynamic loader tries to execute at address 1.

I apologize to subscribers if this is offtopic.

Binutils people can see the original question at
http://gcc.gnu.org/ml/gcc/2004-05/msg00465.html

Henry.






-- 
Henrý Þór Baldursson
Software Developer
FRISK Software International

tel.: +354 540 7425
fax.: +354 540 7401
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://sourceware.org/pipermail/binutils/attachments/20040511/9a9ace95/attachment.sig>


More information about the Binutils mailing list