Compare the inlined kernel tables by their sites in rk sections-diff - #39
Merged
Merged
Conversation
This was referenced Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
__jump_table,__bug_table,__ex_tableand.altinstructionsget an entry for each copy of the code that writes them. When a function with astatic_branch_unlikelyis inlined into three callers, the table gets three entries. So their counts follow the inliner the same way__mcount_locand the objtool site lists do, and plan 9.4 already compares those per function for that reason. Requiring equal counts for these four tables meant matching gcc's inliner call for call in every object, which is not what the check is for.What the check is for is a dropped site: a lost
asm goto, a template whose.pushsectionwent missing, or a key that never got referenced. This change compares these four tables by the set of distinct sites in each object. A site is whatever the entry holds apart from code addresses:__jump_table: the static key and branch bit, named by the symbol it falls in, since gas writes a reference to astaticas section plus offset.__bug_table: the format and file strings by their text, plus line and flags.__ex_table: the fixup type and immediate, with the register bits masked out because they follow register allocation..altinstructions: the CPU feature and flags.Sizes and relocation counts are still recorded and saved, so tables that track counts keep working. The other kernel tables are compared exactly as before. Plan 9.4 has the new rule.
Effect on the 7.2.8 defconfig comparison
__jump_table__bug_table__ex_table.altinstructionsThe
__jump_tableand__bug_tabledifferences left are real. Each one is a key or aWARN_ONthat one compiler keeps and the other folds away.Tests