This is an archive of the discontinued LLVM Phabricator instance.

Don't populate the symbol table with symbols that don't belong to a section with the flag SHF_ALLOC
ClosedPublic

Authored by gw280 on Sep 13 2022, 11:25 AM.

Details

Summary

When populating the symbol table for an ELF object file, don't insert any symbols that come from ELF sections which don't have runtime allocated memory (typically debugging symbols).

Diff Detail

Event Timeline

gw280 created this revision.Sep 13 2022, 11:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 13 2022, 11:25 AM
gw280 requested review of this revision.Sep 13 2022, 11:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 13 2022, 11:25 AM
dblaikie accepted this revision.Sep 13 2022, 11:29 AM

Looks good - one minor change to drop braces from the if. (I can make this change myself if I'm submitting it for you)

Do you need me to submit this for you? (if you don't have LLVM commit access)

llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
174–176
This revision is now accepted and ready to land.Sep 13 2022, 11:29 AM

Looks good - one minor change to drop braces from the if. (I can make this change myself if I'm submitting it for you)

Do you need me to submit this for you? (if you don't have LLVM commit access)

If you could commit it that'd be great. I do not have commit access. Thanks!

mizvekov added inline comments.
llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
173

We generally prefer that, though it does seem unnecessary to declare that for a single use.
Might as well do: if ((Sec.get()->getFlags() & ELF::SHF_ALLOC) == 0))