Re: Creating executable shared libraries ?

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

 



See http://gcc.gnu.org/ml/gcc-help/2003-07/msg00232.html .

Thanks, but I'm still having problems. The shared library can now be run and
call functions without a problem, but argc and argv are garbage.

I never had that problem -- are you sure it really gets it wrong, and it is not just gdb not showing you the right stuff?

Or maybe your arch needs a bit more init or something.

(Also, returning from main segfaults, is that normal ?

No.

Also, I had to change "/lib/ld.so.1" to "/lib/ld-linux.so.2" since the first
one doesn't exist on my box ("ld-linux.so.2" is a symlink to "ld-2.3.2.so").

Yeah, this example code was on an older ppc32-linux system.

Is there a way to have this work with both (or any ld.so's) without a
recompile ? The lib is open source, so compile-time config isn't a problem,
but it'd be nice if pre-compiled binaries could support both. (Tried using
multiple .interp strings, but that didn't seem to work.)

You need the exact same version of ld.so and libc.so anyway, so just have the right one found at compile time -- don't know how to do that the easy way, sorry.


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