This is an archive of the discontinued LLVM Phabricator instance.

[ELF] --fortran-common: prefer STB_WEAK to COMMON
ClosedPublic

Authored by MaskRay on Jul 13 2021, 3:29 PM.

Details

Summary

The ELF specification says "The link editor honors the common definition and
ignores the weak ones." GNU ld and our Symbol::compare follow this, but the
--fortran-common code (D86142) made a mistake on the precedence.

Diff Detail

Event Timeline

MaskRay created this revision.Jul 13 2021, 3:29 PM
MaskRay requested review of this revision.Jul 13 2021, 3:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2021, 3:29 PM
peter.smith accepted this revision.Jul 14 2021, 6:25 AM

LGTM. I don't think that the original intention of D86142 was to differ in this regard. Will be worth giving sfertile some time to object if there is a specific reason.

This revision is now accepted and ready to land.Jul 14 2021, 6:25 AM
sfertile accepted this revision.Jul 14 2021, 6:45 AM

LGTM, thanks for finding and fixing this MaskRay.

This revision was automatically updated to reflect the committed changes.