linux-mips-fnet
[Top] [All Lists]

Re: mipsel-linux-gcc and ld

To: "Bradley D. LaRonde" <brad@ltc.com>
Subject: Re: mipsel-linux-gcc and ld
From: Ralf Baechle <ralf@uni-koblenz.de>
Date: Wed, 21 Jul 1999 01:11:47 +0200
Cc: linuxce-devel@linuxce.org, linux-mips@fnet.fr
In-reply-to: <009901bed2c3$6306d380$b1119526@tecra.ltc.com>; from Bradley D. LaRonde on Tue, Jul 20, 1999 at 11:20:22AM -0400
References: <009901bed2c3$6306d380$b1119526@tecra.ltc.com>
On Tue, Jul 20, 1999 at 11:20:22AM -0400, Bradley D. LaRonde wrote:

> 1.  Why can't I get the kernel to build if I use -O, -O1, or no -O (anything
> except -O2) in the main Makefile CFLAGS?  It fails during link.  Virtually
> every symbol is undefined.  I want to turn off optimizations so that I can
> read the disassembly easier.  Also, I thought that optimizations might be
> causing the problem in #2 below.  It builds fine when I use -O2.

It's because many functions are inline functions.  Gcc only does inlining
when optimizing.

Gcc's code is lousy without optimizer.  It's actually harder to understand
than with -O.

> 2.  Why might ld be liking procedure address wrong (adding 0x00010000 to
> them)?  When I assign a procedure address to a variable (for an indirect
> call), it gets it wrong.  The funny thing is that in a small test program it
> gets it right, but not when I do it in the kernel.

I assume you're looking at some lui/addiu construction in the code.  The
16-bit addiu opperand is 32-bit extended with _sign_, so the an eventual
carry has to be taken care of.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>