It's not an error if a common symbol (uninitialized data, with alignment specified via the aligncomm directive) is replaced with a regular one with initialized data (with alignment specified via the section chunk).
Details
- Reviewers
ruiu pcc rnk - Commits
- rG6141c26486bc: Merging r339049: --------------------------------------------------------------…
rG214d69975cb7: [COFF] Remove a superfluous warning about aligncomm for non-common symbols
rL339658: Merging r339049:
rL339049: [COFF] Remove a superfluous warning about aligncomm for non-common symbols
rLLD339049: [COFF] Remove a superfluous warning about aligncomm for non-common symbols
Diff Detail
- Repository
- rLLD LLVM Linker
Event Timeline
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." |
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.
lgtm
test/COFF/common-replacement.s | ||
---|---|---|
33–36 | Wow, our assembler does that? Crazy. Does gas? |
test/COFF/common-replacement.s | ||
---|---|---|
33–36 | Yes, so it seems. Good that the behaviour happens to match, however strange it is... |
@hans I think it might make sense to merge this to 7.0, the change itself is pretty harmless, just removing an incorrect warning.
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."