[llvm] [RISCV] Move the emitValueToAlignment before the header in emitNoteGnuPropertySection. (PR #151436)

Jesse Huang via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 30 22:01:30 PDT 2025


================
@@ -97,7 +98,6 @@ void RISCVTargetStreamer::emitNoteGnuPropertySection(
 
   // Emit n_desc field
   OutStreamer.emitLabel(NDescBeginSym);
-  OutStreamer.emitValueToAlignment(NoteAlign);
 
   // Emit the feature_1_and property
   OutStreamer.emitIntValue(ELF::GNU_PROPERTY_RISCV_FEATURE_1_AND, 4); // pr_type
----------------
jaidTw wrote:

Since the RV32 note is already aligned at the end of `pr_data`, I think we can only emit `.word 0` for RV64.

 I took a look on other trailing padding implementations, gcc emits `.p2align` for both RV32/64, while glibc only uses  a single `.word 0` for RV64.

https://github.com/llvm/llvm-project/pull/151436


More information about the llvm-commits mailing list