[PATCH] D147763: [ARM] Emit code alignment after .arm and .thumb directives

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 19:38:54 PDT 2023


MaskRay added a comment.

Sorry for the delay.



================
Comment at: llvm/docs/ReleaseNotes.rst:105
 
+- The `.arm` directive now aligns code to the next 4-byte boundary, and
+  the `.thumb` directive aligns code to the next 2-byte boundary.
----------------
Two backsticks in reST for something mostly equivalent in Markdown


================
Comment at: llvm/test/MC/ARM/arm-thumb-directive-alignment.s:1
+@ RUN: llvm-mc -triple armv7-elf -filetype obj -o - %s | llvm-readelf -s - | FileCheck %s
+
----------------
For directive tests, the most common filenames are `directive-*`.

We should test section headers as well: `llvm-readelf -S -s `. Define a custom section and check that its alignment is affected by `.arm`. Then define another section and check its alignment is affected by `.thumb`


================
Comment at: llvm/test/MC/ARM/arm-thumb-directive-alignment.s:22
+.type unaligned_thumb_to_arm,%function
+unaligned_thumb_to_arm:
+    nop
----------------
The name `unaligned_thumb_to_arm` may be confusing as the value is actually aligned. `thumb_to_arm` suffices.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147763/new/

https://reviews.llvm.org/D147763



More information about the llvm-commits mailing list