[FFmpeg-devel] Problem building shared libraries using svn-r11100+ on x86_64

Michael Niedermayer michaelni
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
doesnt work

> - 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.

not true

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071205/2e90ca7a/attachment.pgp>

More information about the ffmpeg-devel mailing list