Why are functions loaded at aligned addresses in x86 Linux for elf executables?

Posted by user344787 on Stack Overflow See other posts from Stack Overflow or by user344787
Published on 2010-05-19T06:48:05Z Indexed on 2010/05/19 6:50 UTC
Read the original article Hit count: 301

Filed under:
|
|

Hi,

I've been looking at Linux elf executables on x86, mostly using IDA but also gdb. One thing I've noticed is functions are always loaded at word aligned addresses? Anybody knows the reason of that? I am not aware of any requirement of x86 instructions to start at aligned addresses. And it cannot be due to page alignment cause the page boundary can still be anywhere within the function.

I would appreciate any insight at all.

Thanks.

© Stack Overflow or respective owner

Related posts about linux

Related posts about elf