Re: dlsym() fails with an executable shared library

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

 



> Worked fine when I tried it.  I built your source code using
>
> gcc -fPIE -pie -o foo.so foo.c -rdynamic

Thanks, it indeed does. I had to leave out -fPIC. I'm curious, why did
that cause a problem?

Last question; is the first method expected to also work on Mac, with
the linker replaced by the appropriate linker for Mac, if I'm using
gcc et al to build? I.e.:

const char my_interp[] __attribute__((section(".interp"))) = "<dyld path>";

(...)

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

In other words, does gcc on Mac support executable shared libraries?

Thanks,
Mayank



[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