This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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


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

Attachment: signature.asc
Description: This is a digitally signed message part


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