Committed.

With the dejagnu status-wrapper, there's a reference to write in
each executable, which for mmix in newlib has a reference to a
variable defined in open, which for mmix in newlib has a
reference to sprintf (oops!) and the dependency-chain goes on;
ad finitum there's a reference to malloc, which in default
newlib is colocated with free; the same file
newlib/libc/stdlib/malloc.c.

Not being compiled with -ffunction-sections, they're emitted in
the same section (.text) and thus inseparable: you can't
override just one of them as in this test, or else you'll get:

<X>/pre/mmix/bin/ld: <X>/gccobj/mmix/./newlib/libc.a(lib_a-malloc.o): in 
function `free':
<X>/gcc/newlib/libc/stdlib/malloc.c:169: multiple definition of `free'; 
/tmp/ccvRA0zb.o:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
compiler exited with status 1
FAIL: gcc.dg/torture/pr59330.c   -O0  (test for excess errors)

I'm using a dg-skip-if here instead of starting a hardly
scalable dg-do target selector.  I'm not keying on
effective-target unwrapped because the dependency-chain is
target-specific rather than dejagnu status-wrapper-specific.

gcc/testsuite:
        * gcc.dg/torture/pr59330.c: Disable for mmix.

--- gcc/gcc/testsuite/gcc.dg/torture/pr59330.c.orig     Sun Jul 26 02:05:57 2020
+++ gcc/gcc/testsuite/gcc.dg/torture/pr59330.c  Sun Jul 26 02:19:29 2020
@@ -1,4 +1,5 @@
 /* { dg-do run } */
+/* { dg-skip-if "free inseparable from malloc when wrapped" { 
mmix-knuth-mmixware } } */

 void free(void *ptr)
 {

Reply via email to