dongjianqiang2 wrote: > My understanding is that this will make all calls to global functions into > long calls. > > In AArch64 static linkes are required to insert range extension thunks for > out of range BLs. In the best case this is just another direct branch, at > worst case for `--pic-veneer` this is just `adrp, add, br`. I would expect > that on-demand linker inserted thunks would outperform making all calls long > for the majority of programs. I'm interested in any data that shows that long > calls works better, and whether that could feed back into the lld thunk > generation code. For example are the thunks too far away from the caller > which causes page faults etc. > > I note that with `-ffunction-sections` and certain linker options calls to > static functions can go out of range too. These would get handled by linker > thunks though.
This option is explicitly designed to enable reliable patching workflows when compiling object files. It is to guarantee call range safety in patches. When modifying/recompiling individual object files (e.g., during security patches),final memory layouts are unknown at compile time, patched functions might end up >128MB away from callers. -mlong-calls forces all cross-object calls to use 64-bit absolute addressing. https://github.com/llvm/llvm-project/pull/142982 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits