This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-971023 cannot compile linux ld.so-1.9.5
- To: akos at is dot s dot u-tokyo dot ac dot jp (Szalkai Akos)
- Subject: Re: egcs-971023 cannot compile linux ld.so-1.9.5
- From: hjl at lucon dot org (H.J. Lu)
- Date: Thu, 30 Oct 1997 20:16:32 -0800 (PST)
- Cc: egcs at cygnus dot com
>
> Hi,
>
> The details: cc1 (from egcs-9710{16,23}, haven't checked others) fails
> with a 'forbidden register spilled' (from reload1.c) error while
> compiling d-link/boot1.c. gcc-2.7.2.3 correctly compiles it.
>
> Looking around the optimization options, it seems that the compiler
> only fails when both -fPIC (or -fpic) and -finline are on. (But ld.so
> does not work with either of them turned off.)
>
> If you need more details, tell me.
>
> Akos
>
>
The bug is in ld.so. Please try this patch.
--
H.J. Lu (hjl@gnu.ai.mit.edu)
--
Index: d-link/Makefile
===================================================================
RCS file: /home/work/cvs/linux/ld-so/d-link/Makefile,v
retrieving revision 1.1.1.2
retrieving revision 1.5
diff -u -r1.1.1.2 -r1.5
Index: d-link/i386/syscall.h
===================================================================
RCS file: /home/work/cvs/linux/ld-so/d-link/i386/syscall.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- syscall.h 1997/03/31 19:33:06 1.1.1.2
+++ syscall.h 1997/07/10 03:37:18 1.2
@@ -87,20 +87,21 @@
"rm" (addr), "rm" (size), "rm" (prot), "rm" (flags),
"rm" (fd), "rm" (f_offset));
#else
+ unsigned long buffer[6];
+
+ buffer[0] = (unsigned long)addr;
+ buffer[1] = (unsigned long)size;
+ buffer[2] = (unsigned long)prot;
+ buffer[3] = (unsigned long)flags;
+ buffer[4] = (unsigned long)fd;
+ buffer[5] = (unsigned long)f_offset;
+
__asm__ volatile ("pushl %%ebx\n\t" \
- "pushl %7\n\t" \
- "pushl %6\n\t" \
- "pushl %5\n\t" \
- "pushl %4\n\t" \
- "pushl %3\n\t" \
- "pushl %2\n\t" \
- "movl %%esp,%%ebx\n\t" \
+ "movl %%ecx,%%ebx\n\t" \
"int $0x80\n\t" \
- "addl $24,%%esp\n\t" \
"popl %%ebx\n" \
: "=a" (malloc_buffer) : "a" (__NR_mmap),
- "rm" (addr), "rm" (size), "rm" (prot), "rm" (flags),
- "rm" (fd), "rm" (f_offset));
+ "c" (buffer));
#endif
return malloc_buffer;
}