Re: dlsym() fails with an executable shared library

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

 



gcc -Wall -W -fPIC -shared -o library.so test.c -lc -Wl,-e,my_main

This is a workable approach, but my_main must act as the entry point of the program. The entry point is not called with argc and argv. Take a
look at crt1.o on your system to see what the entry point must do.

Or look at http://git.infradead.org/users/segher/profall.git .

[ This thing runs its first command line arg, but LD_PRELOADs itself to
it (and anything it forks).  It makes each of those exacutables write
gmon.out files, whether they were linked with -pg or not. ]


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux