[ld script] Can I limit the stack size?

Jonathan Larmour jlarmour@redhat.com
Mon Jan 29 07:20:00 GMT 2001


jw c wrote:
> 
> Hello, all.
> I have a question about linker script.
> My linker script has the following line
> 
> .stack 0xf000 : { _stack = .; *(.stack) *(._stack) }
> 
> so I can set the stack start address.
> I wonder if I also could set the maximum size of
> stack.

Put something else at the address you want the end of the stack to be at,
e.g. .foo 0x10000 : { __foo = . }
I haven't tried this admittedly.

Or if you want to limit it because you don't want it to hit the top of real
memory, use the MEMORY command to describe the memory of your system
exactly. e.g.

MEMORY
{
    rom : ORIGIN = 0x40000000, LENGTH = 0x80000
    ram : ORIGIN = 0x48000000, LENGTH = 0x200000
}

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Un cheval, pas du glue. Pas du cheval, beaucoup du glue. || Opinions==mine


More information about the Binutils mailing list