This is an archive of the discontinued LLVM Phabricator instance.

[MC][ELF] Use SHF_SUNW_NODISCARD instead of SHF_GNU_RETAIN on Solaris
ClosedPublic

Authored by ro on Feb 22 2022, 4:05 AM.

Details

Summary

As requested in D107955, this patch splits off the MC and CodeGen parts and adds a testcase.

Tested on sparcv9-sun-solaris2.11, amd64-pc-solaris2.11, and x86_64-pc-linux-gnu.

Diff Detail

Event Timeline

ro created this revision.Feb 22 2022, 4:05 AM
ro requested review of this revision.Feb 22 2022, 4:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2022, 4:05 AM
MaskRay accepted this revision.Feb 22 2022, 10:37 AM

LGTM.

llvm/lib/MC/MCSectionELF.cpp
108

Maybe conciser: // Print OS-specific flags.`

llvm/test/CodeGen/X86/elf-retain.ll
6
This revision is now accepted and ready to land.Feb 22 2022, 10:37 AM
ro marked an inline comment as done.Feb 22 2022, 12:59 PM
ro added inline comments.
llvm/lib/MC/MCSectionELF.cpp
108

I'd rather keep if for consistency with the next comment.

ro updated this revision to Diff 410622.Feb 22 2022, 1:03 PM

Comment and whitespace fixes.

This revision was landed with ongoing or failed builds.Feb 23 2022, 6:43 AM
This revision was automatically updated to reflect the committed changes.