linux-mips
[Top] [All Lists]

Re: question regarding bss section

To: Teresa Tao <TERESAT@TTI-DM.COM>
Subject: Re: question regarding bss section
From: Ralf Baechle <ralf@linux-mips.org>
Date: Mon, 27 Oct 2003 19:09:57 +0100
Cc: linux-mips@linux-mips.org
In-reply-to: <92F2591F460F684C9C309EB0D33256FA01B750B3@trid-mail1.tridentmicro.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <92F2591F460F684C9C309EB0D33256FA01B750B3@trid-mail1.tridentmicro.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.1i
On Mon, Oct 27, 2003 at 09:44:05AM -0800, Teresa Tao wrote:

> I have several questions and hope somebody could help me with the answers:
> 1. how to use gcc to compile the user mode program with larger stack size?

Not at all.  Stack size is a resource limit which is set with can be
manipulated with setrlimit(2) or in bash with the ulimit command.  It
defaults to 8MB.

For pthread applications the stack size is a thead attribute, seem libc
manual.

> 2. Inside the user mode program, I have declared some gloabal data which
> is being put on the bss section and I would like to know whom initialize
> the bss section?

.bss is uninitialized.  Initialized data can't be in .bss.

> How big is the bss section? Under what kind of situation,

As big as needed for everything in it.

> the bss section data could be corrupted?

There's millions of ways of writing broken code.

> 3. What's the difference to compile the program with -G 0 option? That
> menas I don't use the $gp register, will there be any side effect?

-G 0 is the default for userspace.  Iow. passing the option changed nothing.

  Ralf

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