This is an archive of the discontinued LLVM Phabricator instance.

[LLD][COFF] Fix absolute & synthetic symbols in COFF symbol table
ClosedPublic

Authored by alvinhochun on Sep 22 2022, 11:17 AM.

Details

Summary

Absolute symbol should contain its absolute value, but LLD had been
writing its RVA instead. Write its VA instead.

DefinedSynthetic were being skipped before with the reasoning "Relative
symbols are unrepresentable in a COFF symbol table", which is only true
if the RVA points to outside of a section. LLD does create synthetic
symbols which points to actual data chunks (typical for symbols embedded
into the load config directory). Write these symbols to the COFF symbol
table too.

Diff Detail

Event Timeline

alvinhochun created this revision.Sep 22 2022, 11:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 22 2022, 11:17 AM
alvinhochun requested review of this revision.Sep 22 2022, 11:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 22 2022, 11:17 AM
mstorsjo accepted this revision.Sep 23 2022, 4:01 AM

LGTM, looks reasonable to me!

This revision is now accepted and ready to land.Sep 23 2022, 4:01 AM