[llvm] [RISCV] Improvements to .note.gnu.property section. (PR #151436)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 31 22:38:04 PDT 2025
================
@@ -83,29 +86,21 @@ void RISCVTargetStreamer::emitNoteGnuPropertySection(
OutStreamer.switchSection(NoteSection);
// Emit the note header
- OutStreamer.emitIntValue(4, 4); // n_namsz
-
- MCSymbol *const NDescBeginSym = Ctx.createTempSymbol();
- MCSymbol *const NDescEndSym = Ctx.createTempSymbol();
- const MCExpr *const NDescSzExpr =
- MCBinaryExpr::createSub(MCSymbolRefExpr::create(NDescEndSym, Ctx),
- MCSymbolRefExpr::create(NDescBeginSym, Ctx), Ctx);
-
- OutStreamer.emitValue(NDescSzExpr, 4); // n_descsz
+ OutStreamer.emitValueToAlignment(NoteAlign);
----------------
topperc wrote:
I've removed the section alignment. If the section already existed for some reason, the setAlignment could decrease an already set alignment.
Aligning the note itself seems better to me in case there are other notes including notes that may come from other objects after linking.
https://github.com/llvm/llvm-project/pull/151436
More information about the llvm-commits
mailing list