diff options
author | Reid Kleckner <rnk@google.com> | 2018-02-01 22:39:52 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-02-01 22:39:52 +0000 |
commit | 0e39460d5ee3f6a3b048ed524c12b13be7a9de04 (patch) | |
tree | 742b1559c6ba27209a685eea98bdecc3899850cc | |
parent | ff3a8f17df564a912c12f67ea05107a3f8be41b7 (diff) | |
download | llvm-0e39460d5ee3f6a3b048ed524c12b13be7a9de04.zip llvm-0e39460d5ee3f6a3b048ed524c12b13be7a9de04.tar.gz llvm-0e39460d5ee3f6a3b048ed524c12b13be7a9de04.tar.bz2 |
Merging r323288:
------------------------------------------------------------------------
r323288 | ruiu | 2018-01-23 16:26:57 -0800 (Tue, 23 Jan 2018) | 3 lines
Fix retpoline PLT header size for i386.
Differential Revision: https://reviews.llvm.org/D42397
------------------------------------------------------------------------
llvm-svn: 324026
-rw-r--r-- | lld/ELF/Arch/X86.cpp | 6 | ||||
-rw-r--r-- | lld/test/ELF/i386-retpoline-nopic.s | 68 |
2 files changed, 27 insertions, 47 deletions
diff --git a/lld/ELF/Arch/X86.cpp b/lld/ELF/Arch/X86.cpp index ac71a9b..5d84cd2 100644 --- a/lld/ELF/Arch/X86.cpp +++ b/lld/ELF/Arch/X86.cpp @@ -438,7 +438,7 @@ void RetpolinePic::writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, } RetpolineNoPic::RetpolineNoPic() { - PltHeaderSize = 64; + PltHeaderSize = 48; PltEntrySize = 32; } @@ -464,10 +464,6 @@ void RetpolineNoPic::writePltHeader(uint8_t *Buf) const { 0x59, // 2d: pop %ecx 0xc3, // 2e: ret 0xcc, // 2f: int3 - 0xcc, 0xcc, 0xcc, 0xcc, - 0xcc, 0xcc, 0xcc, 0xcc, - 0xcc, 0xcc, 0xcc, 0xcc, - 0xcc, 0xcc, 0xcc, 0xcc, }; memcpy(Buf, PltData, sizeof(PltData)); assert(sizeof(PltData) == TargetInfo::PltHeaderSize); diff --git a/lld/test/ELF/i386-retpoline-nopic.s b/lld/test/ELF/i386-retpoline-nopic.s index 4de813e..79dd5a6 100644 --- a/lld/test/ELF/i386-retpoline-nopic.s +++ b/lld/test/ELF/i386-retpoline-nopic.s @@ -30,50 +30,34 @@ // CHECK-NEXT: 1103d: 59 popl %ecx // CHECK-NEXT: 1103e: c3 retl // CHECK-NEXT: 1103f: cc int3 -// CHECK-NEXT: 11040: cc int3 -// CHECK-NEXT: 11041: cc int3 -// CHECK-NEXT: 11042: cc int3 -// CHECK-NEXT: 11043: cc int3 -// CHECK-NEXT: 11044: cc int3 -// CHECK-NEXT: 11045: cc int3 -// CHECK-NEXT: 11046: cc int3 -// CHECK-NEXT: 11047: cc int3 -// CHECK-NEXT: 11048: cc int3 -// CHECK-NEXT: 11049: cc int3 -// CHECK-NEXT: 1104a: cc int3 -// CHECK-NEXT: 1104b: cc int3 -// CHECK-NEXT: 1104c: cc int3 -// CHECK-NEXT: 1104d: cc int3 -// CHECK-NEXT: 1104e: cc int3 -// CHECK-NEXT: 1104f: cc int3 -// CHECK-NEXT: 11050: 50 pushl %eax -// CHECK-NEXT: 11051: a1 0c 20 01 00 movl 73740, %eax -// CHECK-NEXT: 11056: e8 d5 ff ff ff calll -43 <.plt+0x20> -// CHECK-NEXT: 1105b: e9 c1 ff ff ff jmp -63 <.plt+0x11> -// CHECK-NEXT: 11060: 68 00 00 00 00 pushl $0 -// CHECK-NEXT: 11065: e9 a6 ff ff ff jmp -90 <.plt> -// CHECK-NEXT: 1106a: cc int3 -// CHECK-NEXT: 1106b: cc int3 -// CHECK-NEXT: 1106c: cc int3 -// CHECK-NEXT: 1106d: cc int3 -// CHECK-NEXT: 1106e: cc int3 -// CHECK-NEXT: 1106f: cc int3 -// CHECK-NEXT: 11070: 50 pushl %eax -// CHECK-NEXT: 11071: a1 10 20 01 00 movl 73744, %eax -// CHECK-NEXT: 11076: e8 b5 ff ff ff calll -75 <.plt+0x20> -// CHECK-NEXT: 1107b: e9 a1 ff ff ff jmp -95 <.plt+0x11> -// CHECK-NEXT: 11080: 68 08 00 00 00 pushl $8 -// CHECK-NEXT: 11085: e9 86 ff ff ff jmp -122 <.plt> -// CHECK-NEXT: 1108a: cc int3 -// CHECK-NEXT: 1108b: cc int3 -// CHECK-NEXT: 1108c: cc int3 -// CHECK-NEXT: 1108d: cc int3 -// CHECK-NEXT: 1108e: cc int3 -// CHECK-NEXT: 1108f: cc int3 +// CHECK-NEXT: 11040: 50 pushl %eax +// CHECK-NEXT: 11041: a1 0c 20 01 00 movl 73740, %eax +// CHECK-NEXT: 11046: e8 e5 ff ff ff calll -27 <.plt+0x20> +// CHECK-NEXT: 1104b: e9 d1 ff ff ff jmp -47 <.plt+0x11> +// CHECK-NEXT: 11050: 68 00 00 00 00 pushl $0 +// CHECK-NEXT: 11055: e9 b6 ff ff ff jmp -74 <.plt> +// CHECK-NEXT: 1105a: cc int3 +// CHECK-NEXT: 1105b: cc int3 +// CHECK-NEXT: 1105c: cc int3 +// CHECK-NEXT: 1105d: cc int3 +// CHECK-NEXT: 1105e: cc int3 +// CHECK-NEXT: 1105f: cc int3 +// CHECK-NEXT: 11060: 50 pushl %eax +// CHECK-NEXT: 11061: a1 10 20 01 00 movl 73744, %eax +// CHECK-NEXT: 11066: e8 c5 ff ff ff calll -59 <.plt+0x20> +// CHECK-NEXT: 1106b: e9 b1 ff ff ff jmp -79 <.plt+0x11> +// CHECK-NEXT: 11070: 68 08 00 00 00 pushl $8 +// CHECK-NEXT: 11075: e9 96 ff ff ff jmp -106 <.plt> +// CHECK-NEXT: 1107a: cc int3 +// CHECK-NEXT: 1107b: cc int3 +// CHECK-NEXT: 1107c: cc int3 +// CHECK-NEXT: 1107d: cc int3 +// CHECK-NEXT: 1107e: cc int3 +// CHECK-NEXT: 1107f: cc int3 // CHECK: Contents of section .got.plt: -// CHECK-NEXT: 00300100 00000000 00000000 60100100 -// CHECK-NEXT: 80100100 +// CHECK-NEXT: 00300100 00000000 00000000 50100100 +// CHECK-NEXT: 70100100 .global _start _start: |