开发者

what's the ELF object file size limitation on 64bit platform?

Assume the x86 64 and linux platform.

If you look into the ELF header, the offset are all 64bit.

So it's easy to create an object file larger than 4G with relocatoin R_X86_64_64. This means a static .o file and executable can be as large as 64bit can represent.

However, for shared library, like gcc , we only have R_X86_64_PLT32 relocation. This means that it's impossible to create a shared library large than 4GB, right?

S开发者_运维技巧o if I want to build a huge program, one of the .o file is huge enough (>4GB) , the only choice is static linking?

Any comment is welcome.

Thanks, limi


The x86-64 ABI used by Linux defines a "large model" specifically to avoid such size limitations, which includes 64-bit relocation types for the GOT and PLT. (See the table in section 4.4.2, and the instruction sequences in 3.5.5 which show how they are used.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜