This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] RISCVELFTargetObjectFile: use 2-byte alignment for .text if RVC
ClosedPublic

Authored by MaskRay on May 9 2023, 8:02 PM.

Details

Summary

For the "C" Standard Extension/Zca, D45560 enabled 2-byte alignment for
assembly output (e.g. clang -S a.c) and D102052 enabled 2-byte alignment for
assembly input and object file output (e.g. clang -c a.s).

This patch ports the behavior for code generation and object file output by
adding RISCVELFTargetObjectFile::getTextSectionAlignment (e.g. clang -c a.c).

Diff Detail

Event Timeline

MaskRay created this revision.May 9 2023, 8:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2023, 8:02 PM
MaskRay requested review of this revision.May 9 2023, 8:02 PM
craig.topper added inline comments.May 9 2023, 8:24 PM
llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCObjectFileInfo.cpp
15

Isn't this a layering violation?

MaskRay updated this revision to Diff 520907.May 9 2023, 10:36 PM

Fix layer violation

MaskRay marked an inline comment as done.May 9 2023, 10:36 PM
This revision is now accepted and ready to land.May 11 2023, 11:50 AM
MaskRay edited the summary of this revision. (Show Details)May 11 2023, 1:42 PM
This revision was landed with ongoing or failed builds.May 11 2023, 1:44 PM
This revision was automatically updated to reflect the committed changes.