[csw-maintainers] assembler in shared libraries

Peter FELECAN pfelecan at opencsw.org
Mon Jun 1 17:43:31 CEST 2009


Trying to package/port projects using optimizations implemented in
assembler I encounter the same issue for which I didn't found a solution.

For the moment, the issue manifests itself only on i386 architecture as
the porting has as source, projects developed on Linux and concerns
mainly video applications, e.g., ffmpeg, xvid, &c.

In the linking phase of the share library I get the following message:

Text relocation remains                 	referenced
    against symbol		    offset	in file
<unknown>                   0x7   	bitstream/x86_asm/cbp_mmx.o
.
.
.
<unknown>                   0xc6   	utils/x86_asm/cpuid.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status

The result of my research can be summarized as follows: don't
use hand written assembly in shared libraries if you're not using the
GNU linker.

The consequences of this are:

- don't activate assembler optimizations: poor performance
- where the previous is not possible, don't generate shared
  libraries containing the assembler code: build only statically linked
  binaries --- at least the corresponding library is statically linked

Is there a fellow maintainer having a positive experience on building
shared libraries for Solaris containing assembler code and willing to
share his solution?

-- 
Peter



More information about the maintainers mailing list