This is an archive of the discontinued LLVM Phabricator instance.

Fix BSS global handling in AsmPrinter
ClosedPublic

Authored by niravd on Jun 8 2016, 11:15 AM.

Details

Summary

Change EmitGlobalVariable to check final assembler section is in BSS
before using .lcomm/.comm directive. This prevents globals from being
put into .bss erroneously when -data-sections is used.

This fixes PR26570.

Diff Detail

Repository
rL LLVM

Event Timeline

niravd updated this revision to Diff 60070.Jun 8 2016, 11:15 AM
niravd retitled this revision from to Fix BSS global handling in AsmPrinter.
niravd added reviewers: echristo, rafael.
niravd updated this object.
niravd added a subscriber: llvm-commits.
rafael edited edge metadata.Jun 14 2016, 3:21 AM
rafael added a subscriber: rafael.

Lgtm. Do you have commit access?

BTW, I don't think there is any value in using a .lcomm or a .local/.comm
pair instead of . section. A followup patch changing that also lgtm :-)

Cheers,
Rafael

This revision was automatically updated to reflect the committed changes.