[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] bugs with dlopening tcc-produced .so
From: |
Basile STARYNKEVITCH |
Subject: |
[Tinycc-devel] bugs with dlopening tcc-produced .so |
Date: |
Mon, 20 Dec 2004 08:02:53 +0100 |
User-agent: |
Mutt/1.5.6+20040907i |
Dear All,
I wrote a small program (GPL license) on
http://starynkevitch.net/Basile/manydl.c which generate "randomly"
some C code, compile and dlopen it. Originally, I wrote it for
benching dlopen (and I found that you can dlopen 30_000 shared objects
together!). To compile this program, just
gcc -Wall -rdynamic -O manydl.c -ldl -o manydl
To run this program, you can specify the number of generated files and
their mean length. For example,
./manydl 50 1200
generate 50 files (ie 50 C sources and their corresponding .so), named
genf_A0.c ... genf_D3.c ... of mean length about 1200 lines.
You can change the C compiler (default is gcc) used inside manydl to
compile the generated C sources with the CC environment
variable. Likewise, you can change the C options (in addition of -fPIC
-shared) with the CFLAGS environment variable. So running
env CC=gcc-3.4 CFLAGS=-O2 ./manydl 30 1600
generate 30 functions (each in its C file) of mean length 1600 lines
(approximately) and compile them with gcc-3.4 -O2
On a Linux/x86/Debian/Sid with glibc version 2.3.2 and ld version
2.15, the command ./manydl 10 200 does work (using gcc -O to compile
its generated stuff)
but the command env CC=/usr/bin/tcc CFLAGS=-O ./manydl 10 200
crashes on the first dlopen. The only difference is the compiler used
to compile the generated files.
Regards.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net
aliases: basile<at>tunes<dot>org = bstarynk<at>nerim<dot>net
8, rue de la Faïencerie, 92340 Bourg La Reine, France
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Tinycc-devel] bugs with dlopening tcc-produced .so,
Basile STARYNKEVITCH <=