Skip to content

Comments

Add symbol kind and structured flags to diff proto output#337

Open
encounter wants to merge 2 commits intomainfrom
diff-symbol-kind
Open

Add symbol kind and structured flags to diff proto output#337
encounter wants to merge 2 commits intomainfrom
diff-symbol-kind

Conversation

@encounter
Copy link
Owner

@encounter encounter commented Feb 23, 2026

Summary

  • Adds DiffSymbolKind enum (SYMBOL_UNKNOWN, SYMBOL_FUNCTION, SYMBOL_OBJECT, SYMBOL_SECTION) and kind field to DiffSymbol
  • Replaces DiffSymbolFlag bitmask enum + uint32 flags with a DiffSymbolFlags message of booleans (global, local, weak, common, hidden, ignored, size_inferred)
  • Removes the symbol filter from DiffObject::new() — all symbols are now included in the output, fixing target_symbol indices being invalid after filtering
  • Consumers can filter symbols themselves using size, kind, and flags.ignored

Motivation

DiffSymbol.target_symbol and DiffRelocation.target_symbol emitted raw indices into the unfiltered Object.symbols array, but the output's symbols array was filtered (skipping size == 0 and Ignored symbols). This made the indices unusable for consumers.

Rather than remapping indices, we include all symbols and give consumers enough metadata to filter on their end.

Expose SymbolKind (Function, Object, Section, Unknown) in the
DiffSymbol proto message, allowing CLI oneshot diff consumers to
distinguish symbol types without inferring from instruction/data
presence.
…essage

Remove the symbol filter (size == 0 / Ignored) from DiffObject so all
symbols are emitted. This fixes target_symbol indices being invalid
after filtering.

Replace the DiffSymbolFlag bitmask enum + uint32 field with a
DiffSymbolFlags message of booleans, adding ignored and size_inferred
flags so consumers can filter on their end.
@encounter encounter changed the title Add symbol kind to diff proto output Add symbol kind and structured flags to diff proto output Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant