This is an archive of the discontinued LLVM Phabricator instance.

[LLD][COFF] Generate map file even if no /out flag is present
ClosedPublic

Authored by pzheng on Sep 23 2022, 1:00 PM.

Details

Summary

Currently LLD does not generate a map file if no /out flag (e.g., /out:a.exe) is
present. This is because LLD derives the map file's name from the default output
file name is no output file name is specified explicitly on the command
line. However, in this case, the default output file name has not been set by
LLD yet when LLD tries to set the name of the map file. This patch fixes this
corner case by moving the logic handling map file flags to a place after the
default output file name is set.

Diff Detail

Event Timeline

pzheng created this revision.Sep 23 2022, 1:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2022, 1:00 PM
pzheng requested review of this revision.Sep 23 2022, 1:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2022, 1:00 PM
pzheng updated this revision to Diff 462591.Sep 23 2022, 2:21 PM

minor update to the commit messasge

pzheng edited the summary of this revision. (Show Details)Sep 23 2022, 5:30 PM
thakis added inline comments.Sep 25 2022, 9:44 AM
lld/test/COFF/map.test
11

Please add a dedicated test instead of coopting an existing one.

pzheng updated this revision to Diff 462746.Sep 25 2022, 11:51 AM

Add a dedicated test

pzheng marked an inline comment as done.Sep 25 2022, 11:51 AM
thakis accepted this revision.Sep 26 2022, 5:33 AM

LGTM, thanks!

This revision is now accepted and ready to land.Sep 26 2022, 5:33 AM

Thanks for reviewing!