Large binaries face relocation overflow issues even with medium and large code models. The ELF format includes sections like .eh_frame that assume 32-bit values regardless of code model, causing unexpected overflows. Using multiple Global Offset Tables (GOTs) spaced every 1.5GiB can help, with each GOT supporting roughly 65 million entries. Theoretically, you can fit about 178 million unique relocations in a 1.5GiB code section before hitting GOT capacity limits. While linker optimizations like multiple GOTs and thunks provide significant headroom, extremely large binaries will eventually require the large code model.

3m read timeFrom fzakaria.com
Post cover image

Sort: