[PATCH] D128082: [BOLT][AArch64] Handle gold linker veneers

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 23 11:18:53 PDT 2022


maksfb added inline comments.


================
Comment at: bolt/test/AArch64/veneer.s:12
+.text
+.align 2
+.global foo
----------------
yota9 wrote:
> maksfb wrote:
> > Why is it `.align 2`? I though AArch64 required 4 bytes.
> It's 1 << 2 = 4 bytes
Are you sure? From https://ftp.gnu.org/old-gnu/Manuals/gas-2.9.1/html_chapter/as_7.html:


```
The way the required alignment is specified varies from system to system. For the a29k, hppa, m68k, m88k, w65, sparc, and Hitachi SH, and i386 using ELF format, the first expression is the alignment request in bytes. For example `.align 8' advances the location counter until it is a multiple of 8. If the location counter is already a multiple of 8, no change is needed.

For other systems, including the i386 using a.out format, it is the number of low-order zero bits the location counter must have after advancement. For example `.align 3' advances the location counter until it a multiple of 8. If the location counter is already a multiple of 8, no change is needed.
```

I suggest using `.p2align` to avoid the confusion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128082



More information about the llvm-commits mailing list