Search This Blog

Loading...

Sunday, December 19, 2010

GCC function padding value

Programmer Question

Whenever I compile C or C++ code with optimizations enable,d GCC aligns functions to a 16-byte boundary (on IA-32). If the function is shorter than 16 bytes, GCC pads it with some bytes, which don't seem to be random at all:



19:   c3                      ret
1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi


It always seems to be either 8d b6 00 00 00 00 ... or 8d 74 26 00.



Do function padding bytes have any significance?



Find the answer here

0 comments:

Post a Comment

Related Posts with Thumbnails