This is an archive of the discontinued LLVM Phabricator instance.

[LLD] [COFF] Remove a superfluous warning about aligncomm for non-common symbols
ClosedPublic

Authored by mstorsjo on Aug 3 2018, 1:08 PM.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

mstorsjo created this revision.Aug 3 2018, 1:08 PM
rnk added a comment.Aug 3 2018, 1:43 PM

Shouldn't be hard to make a test with .s files.

COFF/Driver.cpp
1428

The description in your commit message would make a good comment here, i.e. "If the symbol isn't common, it must have been replaced with a regular symbol, which will carry its own alignment."

In D50268#1187936, @rnk wrote:

Shouldn't be hard to make a test with .s files.

Yup, that's easily done - it's easy to write a testcase which reproduces this thing. I can make it test for some general mechanisms of the replacement of common symbols by defined data (although I guess there are other such tests already?), but checking explicitly that the warning we just removed isn't output seems silly though.

mstorsjo updated this revision to Diff 159086.Aug 3 2018, 2:07 PM

Added a testcase, added the requested comment to the code.

rnk accepted this revision.Aug 6 2018, 10:44 AM

lgtm

test/COFF/common-replacement.s
33–36

Wow, our assembler does that? Crazy. Does gas?

This revision is now accepted and ready to land.Aug 6 2018, 10:44 AM
mstorsjo added inline comments.Aug 6 2018, 10:55 AM
test/COFF/common-replacement.s
33–36

Yes, so it seems. Good that the behaviour happens to match, however strange it is...

This revision was automatically updated to reflect the committed changes.
mstorsjo added a subscriber: hans.Aug 14 2018, 12:05 AM

@hans I think it might make sense to merge this to 7.0, the change itself is pretty harmless, just removing an incorrect warning.