Skip to content

fix(symbols): include weak-object vtables and their static incoming references #1660

Closed

Description

@zackees

Context

Coordinated dashboard consumer: FastLED/dashboard#18

Confirmed against fbuild v2.5.37 and FastLED a439902ac6af64e600031c01b5c2ac0df2e690bc, canonical APA102 sketch on ESP32 Dev. The graph was reanalyzed with explicit target tools first, so this is not the tool-discovery failure.

nm -n -S firmware.elf includes:

3f4084b8 0000004c V _ZTVN2fl23SlimSpiBridgeControllerILNS_10SpiChipsetE7ELNS_6EOrderE10ELNS_3BusE0ELh0EEE

The 76-byte vtable is absent from report.json. symbol_analysis/mod.rs::classify_region accepts T/t/R/r/W/w/D/d/B/b but excludes V/v weak-object types.

The linked ELF contains a 32-bit pointer at vtable + 72 bytes to 0x400d201c. That address is the retained SlimSpiBridgeController<...>::showPixels(...) function (619 bytes, type W, .flash.text). Its called_by and referenced_by are both empty. This is a concrete incoming data reference present in the final binary but missing from the report graph.

Proposal

Include allocated weak-object symbols with region determined by their ELF output section. Extract supported static data-pointer references (vtable/initializer tables) as separately typed incoming edges. Preserve uncertainty where pointer provenance cannot be established; do not call these runtime function callers.

Acceptance criteria

  • RED → GREEN fixture for an allocated V/v vtable in Flash and an allocated weak object in RAM; neither is silently omitted or assigned to the wrong region.
  • RED → GREEN final-ELF vtable-to-function pointer fixture; the target has a typed incoming data reference.
  • Keep physical board totals unchanged; audit attributed totals intentionally as previously omitted symbols are included.
  • Reproduce the 0x3f4084b8 + 72 → 0x400d201c case or an equivalent committed fixture.
  • Dashboard Outstanding work: ledger removal, send_op errors, async API, B5a hardening, espflash native, sector-selective flashing #18 displays the pointer owner and edge kind and no longer marks this case unexplained.

Decisions

P2, confirmed graph gap. Start with static pointers whose storage and target symbols are known; arbitrary indirect-call target inference is a separate problem.

Related issues

#478 added called_by, but explicitly leaves indirect dispatch unresolved. This supplies a verified static retention/reference edge without guessing an indirect runtime call site.

Coordination

Dashboard consumer: FastLED/dashboard #18. Producer work is coordinated across #1659, #1660, and #1661; availability and typed-edge/root contracts must stay consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions