This is an archive of the discontinued LLVM Phabricator instance.

Error on -no-define-common if the output is not relocatable
ClosedPublic

Authored by rafael on Nov 30 2017, 10:28 AM.

Details

Reviewers
ruiu
grimar
Summary

The ELF spec says

Symbols with section index SHN_COMMON may appear only in relocatable objects.

Currently lld can produce file that break that requirement.

Diff Detail

Event Timeline

rafael created this revision.Nov 30 2017, 10:28 AM
ruiu edited edge metadata.Nov 30 2017, 12:19 PM

LGTM with this change.

ruiu added inline comments.Nov 30 2017, 12:25 PM
ELF/Driver.cpp
670–671

checkOptions is a better place to add this code.

grimar accepted this revision.Dec 1 2017, 12:45 AM

Committed version LGTM too.

This revision is now accepted and ready to land.Dec 1 2017, 12:45 AM
grimar closed this revision.Dec 1 2017, 12:45 AM

Was committed as r319473.