[Flac-dev] patches for flac build

Josh Coalson xflac at yahoo.com
Mon Jul 16 11:35:28 PDT 2001


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

I'm still not too clear on all this stuff either.  It
looks like the only relevant section of the manual is
8.2.4;  I could export the function entry points that
way.  But I don't get why this is necessary if the
functions are private to the library.

Matt, do you think this would be enough to make it
work?  What kind of errors (linker?) do you get with
the current code?

Josh


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/




More information about the Flac-dev mailing list