tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Creating .so files.


From: bifferos
Subject: Re: [Tinycc-devel] Creating .so files.
Date: Wed, 29 Aug 2007 12:12:01 +0100 (BST)

--- Rob Landley <address@hidden> wrote:

> On Wednesday 29 August 2007 3:25:04 am bifferos wrote:
> > I tried to produce a .so file with:
> >
> > tcc -shared -r dll.c -o test_dll.so
> >
> > but when dlopen()ing it I got the error:
> >
> > ./test_dll.so: only ET_DYN and ET_EXEC can be loaded
> >
> > Any ideas what I'm doing wrong?
> 
> What version are you using, and what platform are you using it on?

I tried 0.9.23 on Slackware Linux 11.0.  I compiled the same source
code with gcc -shared and it was loaded by my test program no problem.
Then I looked on the list and then discovered the Mercurial repo, so I 
tried the tip of that, and got the same result.

I take it that from your response I am typing the right compilation
command?

The source file contains only:

int TestFunction(int first, int second)
{
 return first+second;
}

'nm test_dll.so' says the function is there.

The test program contained something like:

int main()
{
 void* dp;
 dp = dlopen("./test_dll.so", RTLD_LAZY);
 printf("Error: %s\n", dlerror() );
 ...
}

I also tried with RTLD_NOW, same thing.



      ___________________________________________________________ 
Want ideas for reducing your carbon footprint? Visit Yahoo! For Good  
http://uk.promotions.yahoo.com/forgood/environment.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]