[PATCH] D72473: [COFF] Align ARM64 range extension thunks at instruction boundary
Tom Tan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 10 19:22:50 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7c816492197a: [COFF] Align ARM64 range extension thunks at instruction boundary (authored by TomTan).
Changed prior to commit:
https://reviews.llvm.org/D72473?vs=237140&id=237475#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72473/new/
https://reviews.llvm.org/D72473
Files:
lld/COFF/Chunks.h
lld/test/COFF/arm64-thunks.s
Index: lld/test/COFF/arm64-thunks.s
===================================================================
--- lld/test/COFF/arm64-thunks.s
+++ lld/test/COFF/arm64-thunks.s
@@ -3,10 +3,11 @@
// RUN: lld-link -entry:main -subsystem:console %t.obj -out:%t.exe -verbose 2>&1 | FileCheck -check-prefix=VERBOSE %s
// RUN: llvm-objdump -d %t.exe | FileCheck -check-prefix=DISASM %s
-// VERBOSE: Added 1 thunks with margin {{.*}} in 1 passes
+// VERBOSE: Added 2 thunks with margin {{.*}} in 1 passes
.globl main
.globl func1
+ .globl func2
.text
main:
tbz w0, #0, func1
@@ -15,6 +16,14 @@
.space 0x8000
.section .text$b, "xr"
func1:
+ tbz w0, #0, func2
+ ret
+ .space 1
+ .section .text$c, "xr"
+ .space 0x8000
+ .section .text$d, "xr"
+ .align 2
+func2:
ret
// DISASM: 0000000140001000 .text:
@@ -24,4 +33,11 @@
// DISASM: 14000100c: 10 52 00 91 add x16, x16, #20
// DISASM: 140001010: 00 02 1f d6 br x16
-// DISASM: 140009014: c0 03 5f d6 ret
+// DISASM: 140009014: 60 00 00 36 tbz w0, #0, #12 <.text+0x8020>
+// DISASM: 140009018: c0 03 5f d6 ret
+
+// DISASM: 140009020: 50 00 00 90 adrp x16, #32768
+// DISASM: 140009024: 10 b2 00 91 add x16, x16, #44
+// DISASM: 140009028: 00 02 1f d6 br x16
+
+// DISASM: 14001102c: c0 03 5f d6 ret
Index: lld/COFF/Chunks.h
===================================================================
--- lld/COFF/Chunks.h
+++ lld/COFF/Chunks.h
@@ -510,7 +510,7 @@
class RangeExtensionThunkARM64 : public NonSectionChunk {
public:
- explicit RangeExtensionThunkARM64(Defined *t) : target(t) {}
+ explicit RangeExtensionThunkARM64(Defined *t) : target(t) { setAlignment(4); }
size_t getSize() const override;
void writeTo(uint8_t *buf) const override;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72473.237475.patch
Type: text/x-patch
Size: 1868 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200111/5c20a370/attachment.bin>
More information about the llvm-commits
mailing list