sparc: Fix .udiv plt on libc
commitbdc543e338281da051b3dc06eae96c330a485ce6
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 16 Mar 2017 12:15:57 +0000 (16 09:15 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 6 Apr 2017 18:14:44 +0000 (6 15:14 -0300)
treee4735c7a00f75d884c119f786ac968bd62525047
parentdb3d848e154b00071f4a5e729d5884efad410109
sparc: Fix .udiv plt on libc

With the removal of divdi3 object from sparcv9-linux-gnu build, its
definition came from libgcc and its functions internall calls .udiv.
Since glibc also exports these symbols for compatibility reasons, it
will end up creating PLT calls internally in libc.so.

To avoid it, this patch uses the linker option --wrap to replace all
the internal libc.so .udiv calls to the wrapper __wrap_.udiv. Along
with strong alias in the udiv implementations, it makes linker do
local calls.

Checked on sparcv9-linux-gnu.

* sysdeps/sparc/sparc32/Makefile (libc.so-gnulib): New rule.
* sysdeps/sparc/sparc32/sparcv8/udiv.S (.udiv): Make a strong_alias
to __wrap_.udiv.
* sysdeps/sparc/sparc32/sparcv9/udiv.S (.udiv): Likewise.
* sysdeps/sparc/sparc32/udiv.S (.udiv): Likewise.
ChangeLog
sysdeps/sparc/sparc32/Makefile
sysdeps/sparc/sparc32/sparcv8/udiv.S
sysdeps/sparc/sparc32/sparcv9/udiv.S
sysdeps/sparc/sparc32/udiv.S