Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos



Vulnerability Development: Re: Stack Allocations

Re: Stack Allocations

From: <wwieser_at_gmx.de>
Date: Sat, 14 Jul 2001 16:20:50 +0200

On Monday 09 July 2001 15:27, msoda_at_aspre.net wrote:
> Hey all,
>
<snip>
> When running 'gcc -S' it shows that 24 bytes are allocated on the stack
> for buf[]. I thought it should allocate only 16 bytes. It works fine, it
> just makes no sense to me. If I tweak the assembly and change it to 16
> bytes and also change the offsets to %ebp that reference it, it works fine
> also.
>
> Does anyone know why gcc does this? My need to understand everything is
> killing me!
>
It's due to gcc's preferred stack boundary. Seems to be some sort of
alignment issue.
Simply do a
bash# gcc -mpreferred-stack-boundary=2 -S foo.c -o foo.s
and you get 16 bytes as expected.

wwieser
Received on Jul 14 2001

[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
edgeos