This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix gcc.c-torture/execute/20010124-1 on MIPS...
- From: David Daney <ddaney at avtrex dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 08 Sep 2005 09:55:45 -0700
- Subject: [PATCH] Fix gcc.c-torture/execute/20010124-1 on MIPS...
I am experiencing gcc testsuite failures on mipsel-linux with binutils
2.16.1 for gcc.c-torture/execute/20010124-1.c. The problem is that gcc
is generating a CALL16 reloc against the static memcpy, which the linker
does not like.
This is the error:
/usr/local/mipsel-linux-test/mipsel-linux/bin/ld: /tmp/ccuIEkhF.o:
CALL16 reloc at 0x58 not against global symbol.
My solution is to make the testcase's memcpy a global instead of static.
It seems the right solution. One thing I am not sure of is how this
will effect non-ELF based systems.
Will this cause multiple definition errors somewhere with libc's memcpy?
Tested on mipsel-linux-gnu and i686-pc-linux-gnu against just this testcase.
2005-09-06 David Daney <ddaney@avtrex.com>
* gcc.c-torture/execute/20010124-1.c (memcpy): Make it not static.
OK to commit if no regressions on a full testsuite run?
David Daney.
Index: gcc.c-torture/execute/20010124-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/20010124-1.c,v
retrieving revision 1.1
diff -c -p -r1.1 20010124-1.c
*** gcc.c-torture/execute/20010124-1.c 25 Jan 2001 00:16:42 -0000 1.1
--- gcc.c-torture/execute/20010124-1.c 8 Sep 2005 16:42:03 -0000
*************** static void g(union U *p)
*** 40,46 ****
{
}
! static void *memcpy(void *a, const void *b, size_t len)
{
if (a < b && a+len > b)
abort ();
--- 40,47 ----
{
}
! /* Cannot be static or link fails on mipsel-linux-gnu binutils 2.16.1 */
! void *memcpy(void *a, const void *b, size_t len)
{
if (a < b && a+len > b)
abort ();