Subject: Re: NetBSD without MMU ?
To: Neil Ludban <>
From: Jason R Thorpe <>
List: tech-ports
Date: 04/14/2002 14:24:20
On Sun, Apr 14, 2002 at 04:50:36PM -0400, Neil Ludban wrote:

 > MIPS:
 > `-G NUM'
 >      Put global and static items less than or equal to NUM bytes into
 >      the small data or bss sections instead of the normal data or bss
 >      section.  This allows the assembler to emit one word memory
 >      reference instructions based on the global pointer (GP or $28),
 >      instead of the normal two words used.  By default, NUM is 8 when
 >      the MIPS assembler is used, and 0 when the GNU assembler is used.
 >      The `-G NUM' switch is also passed to the assembler and linker.
 >      All modules should be compiled with the same `-G NUM' value.

The way the GP is used on MIPS (and Alpha) is not really the same
thing as the "process data pointer" thing.  In this case, it's a
performance optimization for "small" global data[*], assuming you have
a small enough amount of small data to fit into the .sdata and .sbss

[*] The GP (global pointer) generally points to the middle of the
"small data region" (the combination of the .sdata and .sbss sections,
which the linker arranges next to each other), and 16-bit +/- offsets
can be used to load things relative to the GP.

        -- Jason R. Thorpe <>