This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix libgcc symbols for sh4
kaz Kojima wrote:
With this patch, libgcc_s.so exports __sdivsi3_i4, doesn't it?
__sdivsi3_i4 is a special library function and gcc generates
the code which assumes that __sdivsi3_i4 never clobbers r0 register.
But if libgcc_s.so exports __sdivsi3_i4, it can be called via PLT
which clobbers r0 in SH case. It will break the above assumption. See
<URL:http://www.geocrawler.com/mail/msg.php3?msg_id=6767865&list=3076>
for example.
Uh-oh. Then I guess I'm back to square one... Here's the original problem
that patch was supposed to fix:
> Building gcc-3.4-20030813 on x86 with target sh4-linux fails for me while
> linking libstdc++-v3/testsuite/abi_check.c. ...
>
> Here's the log:
>
> /crosstool-0.18/build/sh4-unknown-linux-gnu/gcc-3.4-20030813-glibc-2.3.2/build-gcc/gcc/g++ \
> -shared-libgcc \
> -B/crosstool-0.18/build/sh4-unknown-linux-gnu/gcc-3.4-20030813-glibc-2.3.2/build-gcc/gcc/ \
> -nostdinc++ \
> -B/opt/cegl-2.0/sh4-unknown-linux-gnu/gcc-3.4-20030813-glibc-2.3.2/sh4-unknown-linux-gnu/bin/ \
> -B/opt/cegl-2.0/sh4-unknown-linux-gnu/gcc-3.4-20030813-glibc-2.3.2/sh4-unknown-linux-gnu/lib/ \
> -isystem
> /opt/cegl-2.0/sh4-unknown-linux-gnu/gcc-3.4-20030813-glibc-2.3.2/sh4-unknown-linux-gnu/include \
> -isystem
> /opt/cegl-2.0/sh4-unknown-linux-gnu/gcc-3.4-20030813-glibc-2.3.2/sh4-unknown-linux-gnu/sys-include \
> -include bits/stdc++.h -g -O2 -D_GNU_SOURCE -o abi_check abi_check.o \
> -L/crosstool-0.18/build/sh4-unknown-linux-gnu/gcc-3.4-20030813-glibc-2.3.2/build-gcc/sh4-unknown-linux-gnu/libstdc++-v3/src \
> -L/crosstool-0.18/build/sh4-unknown-linux-gnu/gcc-3.4-20030813-glibc-2.3.2/build-gcc/sh4-unknown-linux-gnu/libstdc++-v3/src/.libs \
> -lm
>
> /opt/cegl-2.0/sh4-unknown-linux-gnu/gcc-3.4-20030813-glibc-2.3.2/sh4-unknown-linux-gnu/bin/ld: abi_check: hidden symbol `__sdivsi3_i4' in
> /crosstool-0.18/build/sh4-unknown-linux-gnu/gcc-3.4-20030813-glibc-2.3.2/build-gcc/gcc/libgcc.a(_sdivsi3_i4.oS) is referenced by DSO
Do you see this failure?
Thanks,
Dan
--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045