[llvm] [AArch64][ELF] Section alignment of 4 for AArch64 instruction (PR #114031)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 02:51:14 PST 2024


================
@@ -202,6 +202,11 @@ class AArch64ELFStreamer : public MCELFStreamer {
       LastEMS = EMS_None;
 
     MCELFStreamer::changeSection(Section, Subsection);
+
+    // Section alignment of 4 to match GNU Assembler
+    if ((Section->getAlign() < 4) && Section->isText()) {
+      Section->setAlignment(Align(4));
+    }
----------------
lenary wrote:

```suggestion
    if (Section->isText())
      Section->ensureMinAlignment(Align(4));
```

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


More information about the llvm-commits mailing list