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?