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
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.