forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BOLT] Align constant islands to 8 bytes
AArch64 requires CI to be aligned to 8 bytes due to access instructions restrictions. E.g. the ldr with imm, where imm must be aligned to 8 bytes. Differential Revision: https://reviews.llvm.org/D122065
- Loading branch information
Showing
5 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// This test checks that the constant island is aligned after BOLT tool. | ||
// In case the nop before .Lci will be removed the pointer to exit function | ||
// won't be alinged and the test will fail. | ||
|
||
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown \ | ||
# RUN: %s -o %t.o | ||
# RUN: %clang %cflags -fPIC -pie %t.o -o %t.exe -Wl,-q \ | ||
# RUN: -nostartfiles -nodefaultlibs -lc | ||
# RUN: llvm-bolt %t.exe -o %t.bolt -use-old-text=0 -lite=0 -trap-old-code | ||
# RUN: llvm-objdump -d --disassemble-symbols='$d' %t.bolt | FileCheck %s | ||
|
||
.text | ||
.align 4 | ||
.global | ||
.type dummy, %function | ||
dummy: | ||
add x0, x0, #1 | ||
ret | ||
|
||
.global | ||
.type exitOk, %function | ||
exitOk: | ||
mov x0, #0 | ||
bl exit | ||
|
||
.global _start | ||
.type _start, %function | ||
_start: | ||
adrp x0, .Lci | ||
ldr x0, [x0, #:lo12:.Lci] | ||
blr x0 | ||
mov x1, #1 | ||
bl exit | ||
nop | ||
# CHECK: {{0|8}} <$d>: | ||
.Lci: | ||
.xword exitOk | ||
.xword 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters