We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37dc063 commit 9bc30a6Copy full SHA for 9bc30a6
lld/ELF/Arch/X86_64.cpp
@@ -1166,14 +1166,14 @@ void RetpolineZNow::writePltHeader(uint8_t *buf) const {
1166
void RetpolineZNow::writePlt(uint8_t *buf, const Symbol &sym,
1167
uint64_t pltEntryAddr) const {
1168
const uint8_t insn[] = {
1169
- 0x4c, 0x8b, 0x1d, 0, 0, 0, 0, // mov foo@GOTPLT(%rip), %r11
1170
- 0xe9, 0, 0, 0, 0, // jmp plt+0
1171
- 0xcc, 0xcc, 0xcc, 0xcc, // int3; padding
+ 0xf3, 0x0f, 0x1e, 0xfa, // 0: endbr64
+ 0x4c, 0x8b, 0x1d, 0, 0, 0, 0, // 4: mov foo@GOTPLT(%rip), %r11
+ 0xe9, 0, 0, 0, 0, // b: jmp plt+0
1172
};
1173
memcpy(buf, insn, sizeof(insn));
1174
1175
- write32le(buf + 3, sym.getGotPltVA() - pltEntryAddr - 7);
1176
- write32le(buf + 8, in.plt->getVA() - pltEntryAddr - 12);
+ write32le(buf + 7, sym.getGotPltVA() - pltEntryAddr - 11);
+ write32le(buf + 12, in.plt->getVA() - pltEntryAddr - 16);
1177
}
1178
1179
static TargetInfo *getTargetInfo() {
0 commit comments