Skip to content

Conversation

@EricRahm
Copy link
Collaborator

When processing symbol table names an error would be thrown if the the
name was undefined (0) resulting in failures to process files like:

bloaty: can't read index 0 from strtab, total size is 254049

This modifies the symbol table processing to return an empty string if
the name is undefined. An empty string will trigger the existing logic
to generate a synthetic "Anonymous" name instead of crashing.

Fixes: #217
Fixes: #345

When processing symbol table names an error would be thrown if the the
name was undefined (0) resulting in failures to process files like:

> bloaty: can't read index 0 from strtab, total size is 254049

This modifies the symbol table processing to return an empty string if
the name is undefined. An empty string will trigger the existing logic
to generate a synthetic "Anonymous" name instead of crashing.

Fixes: google#217
Fixes: google#345
Adds a lit test to make sure an "Anonymous" entry is emitted if a symbol
table entry has an undefined name.
@EricRahm EricRahm requested a review from haberman December 11, 2025 18:32
@EricRahm
Copy link
Collaborator Author

@haberman pretty small fix, builds on #467 where we added support for synthetic names.

@EricRahm EricRahm merged commit fb40a39 into google:main Dec 11, 2025
9 checks passed
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.

Can't read index 0 from strtab Symbols with no name should use the address for their "name"

2 participants