On Mon, May 26, 2025 at 08:22:59PM +0200, Peter Zijlstra wrote: > On Fri, May 09, 2025 at 01:17:16PM -0700, Josh Poimboeuf wrote: > > > Without '-ffunction-sections -fdata-sections', reliable object diffing > > would be infeasible due to toolchain limitations: > > > > - For intra-file+intra-section references, the compiler might > > occasionally generated hard-coded instruction offsets instead of > > relocations. > > > > - Section-symbol-based references can be ambiguous: > > > > - Overlapping or zero-length symbols create ambiguity as to which > > symbol is being referenced. > > > > - A reference to the end of a symbol (e.g., checking array bounds) > > can be misinterpreted as a reference to the next symbol, or vice > > versa. > > > > A potential future alternative to '-ffunction-sections -fdata-sections' > > would be to introduce a toolchain option that forces symbol-based > > (non-section) relocations. > > Urgh.. So the first issue we can fix with objtool, but the ambiguous > cases are indeed very hard to fix up in post. > > Did you already talk to toolchain people about this?
For now, I want to stick with -ffunction-sections -fdata-sections, as that's what kpatch has done for 10+ years and it works well. That's the only option we have for current compilers anyway. The above mentioned possibility of diffing without -ffunction-sections -fdata-sections is theoretical, and needs more exploration. If it indeed works then we can try to get toolchain support for that. -- Josh