[PATCH] Improve and consolidate sparc PIC assembler.

David Miller davem at davemloft.net
Sat Apr 13 20:59:33 CEST 2013


From: Torbjorn Granlund <tg at gmplib.org>
Date: Sat, 13 Apr 2013 12:10:33 +0200

> David Miller <davem at davemloft.net> writes:
> 
>   	* mpn/sparc32/sparc-defs.m4 (LEA): Remove unused local label.
>   	(LEA_LEAF): Likewise.
>   
> This patch helped the get past the Slowlaris assembler, which
> can only cope with single-digit labels.
> 
> But there are now errors when greating the shared library:
> 
> /bin/bash ./libtool --tag=CC   --mode=link gcc -std=gnu99  -O2 -pedantic \
> -m64 -mptr64 -mcpu=ultrasparc3 -Wc,-m64  -version-info 11:1:1  -o \
> libgmp.la -rpath /usr/local/lib assert.lo compat.lo ...
> 
> gcc -std=gnu99 -shared  -fPIC -DPIC -Wl,-z -Wl,text -Wl,-h \
> -Wl,libgmp.so.10 -o .libs/libgmp.so.10.1.1  .libs/assert.o \
> .libs/compat.o ... rand/.libs/randmui.o   -lc  -O2 -m64 -mptr64 \
> -mcpu=ultrasparc3 -m64
> 
> ld: fatal: relocation error: R_SPARC_GOTDATA_OP_LOX10: file mpn/.libs/gcd_1.o: symbol ctz_table: relocation illegal for TLS symbol
> ld: fatal: relocation error: R_SPARC_GOTDATA_OP: file mpn/.libs/gcd_1.o: symbol ctz_table: relocation illegal for TLS symbol
> 
> TLS?  Thread local storage?

Sun's tools give the worst diagnostics in the world.  Yes, that's what it
means by TLS.

And no I have no idea why it's complaining like this :-/

Maybe because ctz_zero is in .rodata?  That shouldn't matter at all, gcc
emits things like that all the time.

Is there a "ctz_table" in libc.so by chance?  If so, then changing the
name of the table should be sufficient to fix the problem.


More information about the gmp-devel mailing list