Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
119 user(s) are online (105 user(s) are browsing Forums)

Members: 1
Guests: 118

emeck, more...

Support us!

Headlines

 
  Register To Post  

How do you set a "stack cookie?"
Home away from home
Home away from home


See User information
The title says it all. The GLU based demos in MiniGL require more stack space than the default on my system, so I thought that I'd add a stack cookie in order to ensure that they have enough stack. I just don't know how.

I would ask on utilitybase, but that site has been setting off avast antivirus recently, and is now listed as an attack site.

So, how is it done?

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: How do you set a "stack cookie?"
Supreme Council
Supreme Council


See User information
@Hans

In the same way you'd set a version string, the stack cookie can be set like so:

static const char *__attribute__((used)) stack = "$STACK: 65535\0";

Simon

Go to top
Re: How do you set a "stack cookie?"
Just popping in
Just popping in


See User information
@Rigo

Just use the USED define in amiga-compiler.h which is
automatically included.

static USED const char *stack = "$STACK:65535";

Go to top
Re: How do you set a "stack cookie?"
Just can't stay away
Just can't stay away


See User information
@colinw

Is \0 needed in the end of a string ?

Rock lobster bit me - so I'm here forever
X1000 + AmigaOS 4.1 FE
"Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray
Go to top
Re: How do you set a "stack cookie?"
Just popping in
Just popping in


See User information
@TSK

Quote:

TSK wrote:
@colinw

Is \0 needed in the end of a string ?


No. The compiler does this automatically.

Go to top
Re: How do you set a "stack cookie?"
Not too shy to talk
Not too shy to talk


See User information
@colinw

Do DOS library scan for this cookie? and do it overwrite icon settings?

RWO

Go to top
Re: How do you set a "stack cookie?"
Just popping in
Just popping in


See User information
@rwo

Yes, DOS uses it in RunCommand().
Workbench uses it too, and also the shell handler.

See; IDOS->FindSegmentStackSize() function.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project