[FFmpeg-devel] Problem building shared libraries using svn-r11100+ on x86_64
Wed Dec 5 00:12:13 CET 2007
On Tue, Dec 04, 2007 at 09:30:01PM +0100, Nicolas George wrote:
> (Before I found the simplicity of that solution, I wrote a lengthy
> discussion about the problem. I leave it here for documentary purposes:)
> - When building a shared library, references to globals must go through an
> indirection. The compiler is informed to do so by the -fPIC option; it has
> a small performance hit, so it is not the default.
the ELF shared lib system needs PIC and indirection, this is not a fundamental
need of shared libs rather a limitation of the currently used ELF shared libs,
give each lib a constant address on a system after boot and after installing
new libs, and no PIC nor indirection is needed
this also makes many security exploits impossibl (the ones which depend on
changing the indirection pointers ...)
also even with ELF its only globals which are not part of the same lib which
need the indirection
and these can ALWAYS be implemented by relocations if the code in which they
are is speed critical its a limitation of the loader and linker if it
> - On i386, GNU ld is able to link shared libraries even if the code is not
> relocatable, but this is a hack very architecture-specific, and can not
> work on other architectures, especially not x86_64.
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The worst form of inequality is to try to make unequal things equal.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
More information about the ffmpeg-devel