[Flac-dev] patches for flac build

Matt Zimmerman mdz at debian.org
Tue Jul 10 16:55:02 PDT 2001


On Tue, Jul 10, 2001 at 03:27:05PM -0700, Josh Coalson wrote:

> > Unfortunately, there is a bigger problem that affects both SDL and FLAC,
> > which is that the assembly routines are not PIC.
> 
> It's not?  I think all the IA32 code only references data on the stack, and
> it doesn't call outside the library or export any functions outside the
> library.  The only absolute addresses should be the routine entry points
> private to the library which I thought were always relocatable.

The functions themselves, as far as I can tell, only reference data on the
stack as you say.  It is the entry points which are not position-independent
(though they are relocatable).

I confess to not quite being a wizard at this (yet), but as I understand it,
shared library code should be position-independent (using relative addresses)
rather than just relocatable (which could mean that some addresses must be
patched by the runtime linker).  For the calls to be PIC, they must be made
through an offset stored in the GOT.

There is a section in the NASM manual (8.2 in my copy), titled "Writing
NetBSD/FreeBSD/OpenBSD and Linux/ELF Shared Libraries" that seems to explain
how to write position-independent code with NASM.

-- 
 - mdz





More information about the Flac-dev mailing list