This is really useful! I only knew about -mcmodel during compilation but I didn’t know the linker would insert thunks for faraway branches. I would’ve thought that the linker would simply complain and ask you to recompile with a larger code model. Also interesting that different linkers (or the same linker on different architectures!) chose different thunk creation algorithms.