Moi Oleg,

  as far as I know the ELF linker can only produce shared object files (so) and not executable files. I get round this by writing a small C program that uses dlopen to load the shared object file, the initialization code of the so then get executed when the C program runs.

Moi moi

   Andrew

On 26/02/2008, Oleg N. Cher <allot@ukr.net> wrote:

Dear all,

I tried to launch HelloWorld produced by ELF linker.

MODULE LinHello; (* nonportable *)
IMPORT Lin:=LinLibc;

BEGIN
        IF 1=Lin.printf (" Hello World! ") THEN END
END LinHello.

Generate independent Linux console application:
  DevElfLinker.LinkDll HelloWorld := LinHello$ ~

stef@fish:~$ ./HelloWorld
Illegal instruction

stef@fish:~$ file `which ls`
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped

stef@fish:~$ file HelloWorld
HelloWorld: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped

I draw a conclusion that there are difference between
the shared object and the executable format.
Or maybe incorrect linked? Who helps?

I try to email to Fyodor Tkachov.

Good luck.
Oleg N. Cher
allot@ukr.net
2008-02-26

----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV@LISTS.OBERON.CH

---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV@LISTS.OBERON.CH ¿0%vp