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

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 31 07:47:39 PDT 2024


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

it might be better/easier to check if the section is executable? that's probably the only info you have when the section is brand new (I think `hasInstructions` only becomes true when the first instruction is emitted into the section)

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


More information about the llvm-commits mailing list