[llvm-branch-commits] MC: Add directive for specifying a section's preferred alignment. (PR #150151)

Vitaly Buka via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 13 12:37:02 PST 2026


================
@@ -28,6 +28,21 @@ hexadecimal format instead of decimal if desired.
   .section .data
   .float 0x1c2.2ap3
 
+``.prefalign`` directive
+------------------------
+
+The ``.prefalign`` directive sets the preferred alignment for a section,
+and enables the section's final alignment to be set in a way that is
+dependent on the section size (currently only supported with ELF).
+
+If the section size is less than the section's minimum alignment as
+determined using ``.align`` family directives, the section's alignment
+will be equal to its minimum alignment. Otherwise, if the section size is
----------------
vitalybuka wrote:

why it's min?
higher alignment should satisfy any unknown constraints user is asking for.

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


More information about the llvm-branch-commits mailing list