This is the mail archive of the gcc-help@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]

Making functions visible from a shared library


I have a problem making functions visible from a shared library, so when the 
library is loaded from an executable --with dlopen()-- it could call them 
via a pointer.
I have tried to recompile with g++ and link with ld, but after dlopen() I 
got the error "PT_LOAD segments not page-aligned".

Does anyone have an idea what this could be? Or mey it be simply a 
compiler/linker switch?

As a reference here is my compiler command:
g++ -g -c -v -nostdlib -lgcc -I/home/headers -D unix -o <lib_name>.o 
<lib_name>.c

And linker command:
ld -nostdlib -export-dynamic -shared -lgcc -lm <obj_to_link>.o -lm 
<obj_to_link2>.o  -o <lib_name> <lib_name>.o


Thank you all.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


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