Skip to content

MC: Centralize X86 PC-relative fixup adjustment in MCAssembler #147113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions bolt/lib/Target/X86/X86MCPlusBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2441,6 +2441,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {

assert(FKI.TargetOffset == 0 && "0-bit relocation offset expected");
const uint64_t RelOffset = Fixup.getOffset();
auto [RelSymbol, RelAddend] = extractFixupExpr(Fixup);

uint32_t RelType;
if (Fixup.isPCRel()) {
Expand All @@ -2452,6 +2453,9 @@ class X86MCPlusBuilder : public MCPlusBuilder {
case 32: RelType = ELF::R_X86_64_PC32; break;
case 64: RelType = ELF::R_X86_64_PC64; break;
}
// Adjust PC-relative fixup offsets, which are calculated from the start
// of the next instruction.
RelAddend -= FKI.TargetSize / 8;
} else {
switch (FKI.TargetSize) {
default:
Expand All @@ -2463,8 +2467,6 @@ class X86MCPlusBuilder : public MCPlusBuilder {
}
}

auto [RelSymbol, RelAddend] = extractFixupExpr(Fixup);

return Relocation({RelOffset, RelSymbol, RelType, RelAddend, 0});
}

Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/MC/MCValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class MCValue {
friend class MCExpr;
MCValue() = default;
int64_t getConstant() const { return Cst; }
void setConstant(int64_t C) { Cst = C; }
uint32_t getSpecifier() const { return Specifier; }
void setSpecifier(uint32_t S) { Specifier = S; }

Expand Down
35 changes: 33 additions & 2 deletions llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ class X86AsmBackend : public MCAsmBackend {

MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const override;

bool shouldForceRelocation(const MCFixup &, const MCValue &);

std::optional<bool> evaluateFixup(const MCFragment &, MCFixup &, MCValue &,
uint64_t &) override;
void applyFixup(const MCFragment &, const MCFixup &, const MCValue &Target,
MutableArrayRef<char> Data, uint64_t Value,
bool IsResolved) override;
Expand Down Expand Up @@ -678,6 +678,37 @@ static unsigned getFixupKindSize(unsigned Kind) {
}
}

constexpr char GotSymName[] = "_GLOBAL_OFFSET_TABLE_";

// Adjust PC-relative fixup offsets, which are calculated from the start of the
// next instruction.
std::optional<bool> X86AsmBackend::evaluateFixup(const MCFragment &,
MCFixup &Fixup,
MCValue &Target, uint64_t &) {
if (Fixup.isPCRel()) {
switch (Fixup.getTargetKind()) {
case FK_Data_1:
Target.setConstant(Target.getConstant() - 1);
break;
case FK_Data_2:
Target.setConstant(Target.getConstant() - 2);
break;
default: {
Target.setConstant(Target.getConstant() - 4);
auto *Add = Target.getAddSym();
// If this is a pc-relative load off _GLOBAL_OFFSET_TABLE_:
// leaq _GLOBAL_OFFSET_TABLE_(%rip), %r15
// this needs to be a GOTPC32 relocation.
if (Add && Add->getName() == GotSymName)
Fixup = MCFixup::create(Fixup.getOffset(), Fixup.getValue(),
X86::reloc_global_offset_table);
} break;
}
}
// Use default handling for `Value` and `IsResolved`.
return {};
}

void X86AsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
const MCValue &Target,
MutableArrayRef<char> Data, uint64_t Value,
Expand Down
16 changes: 4 additions & 12 deletions llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,9 @@ enum GlobalOffsetTableExprKind { GOT_None, GOT_Normal, GOT_SymDiff };
/// ELF i386 as _GLOBAL_OFFSET_TABLE_ is magical. We check only simple case that
/// are know to be used: _GLOBAL_OFFSET_TABLE_ by itself or at the start of a
/// binary expression.
///
/// TODO: Move this to X86AsmBackend.cpp at relocation decision phase so that we
/// don't have to mess with MCExpr.
static GlobalOffsetTableExprKind
startsWithGlobalOffsetTable(const MCExpr *Expr) {
const MCExpr *RHS = nullptr;
Expand Down Expand Up @@ -587,22 +590,11 @@ void X86MCCodeEmitter::emitImmediate(const MCOperand &DispOp, SMLoc Loc,
}
}

// If the fixup is pc-relative, we need to bias the value to be relative to
// the start of the field, not the end of the field.
if (PCRel) {
ImmOffset -= Size;
// If this is a pc-relative load off _GLOBAL_OFFSET_TABLE_:
// leaq _GLOBAL_OFFSET_TABLE_(%rip), %r15
// this needs to be a GOTPC32 relocation.
if (Size == 4 && startsWithGlobalOffsetTable(Expr) != GOT_None)
FixupKind = X86::reloc_global_offset_table;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't removing this have an effect on test output?

Copy link
Member Author

@MaskRay MaskRay Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has no effect on all the _GLOBAL_OFFSET_TABLE_ (https://maskray.me/blog/2021-08-29-all-about-global-offset-table#got-optimization#global_offset_table_) uses LLVM emits or hand-written assembly uses in practice

In 2020, I added this piece of code in reviews.llvm.org/D47507. I am actually not sure I got everything correct, but moving the code from MCCodeEmitter (parse time) to AsmBackend (relocation decision time) is the right direction.

% rg '(lea|mov).*_GLOBAL' lld/test/ELF llvm/test/MC/X86/
lld/test/ELF/x86-64-reloc-gotpc64.s
14:  movabsq $_GLOBAL_OFFSET_TABLE_-., %r11

lld/test/ELF/relocation-i686.s
66: movl $_GLOBAL_OFFSET_TABLE_, %eax

lld/test/ELF/x86-64-reloc-gotoff64.s
23:  leaq _GLOBAL_OFFSET_TABLE_(%rip), %rdx

lld/test/ELF/i386-gotpc.s
7:movl $_GLOBAL_OFFSET_TABLE_, %eax

}

if (ImmOffset)
Expr = MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(ImmOffset, Ctx),
Ctx, Expr->getLoc());

// Emit a symbolic constant as a fixup and 4 zeros.
// Emit a symbolic constant as a fixup and a few zero bytes.
Fixups.push_back(MCFixup::create(static_cast<uint32_t>(CB.size() - StartByte),
Expr, FixupKind, PCRel));
emitConstant(0, Size, CB);
Expand Down
12 changes: 6 additions & 6 deletions llvm/test/CodeGen/X86/AMX/amx-lower-tile-copy.ll
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ define dso_local void @test1(ptr%buf) nounwind {
; EGPR-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
; EGPR-NEXT: testb %al, %al # encoding: [0x84,0xc0]
; EGPR-NEXT: jne .LBB0_3 # encoding: [0x75,A]
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_3-1, kind: FK_PCRel_1
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_3, kind: FK_PCRel_1
; EGPR-NEXT: # %bb.1: # %loop.header.preheader
; EGPR-NEXT: movq %rdi, %rbx # encoding: [0x48,0x89,0xfb]
; EGPR-NEXT: xorl %r14d, %r14d # encoding: [0x45,0x31,0xf6]
Expand All @@ -100,7 +100,7 @@ define dso_local void @test1(ptr%buf) nounwind {
; EGPR-NEXT: # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7a,0x4b,0x9c,0x04,0xd0,0x0b,0x00,0x00]
; EGPR-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
; EGPR-NEXT: callq foo # encoding: [0xe8,A,A,A,A]
; EGPR-NEXT: # fixup A - offset: 1, value: foo-4, kind: reloc_branch_4byte_pcrel
; EGPR-NEXT: # fixup A - offset: 1, value: foo, kind: reloc_branch_4byte_pcrel
; EGPR-NEXT: ldtilecfg {{[0-9]+}}(%rsp) # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x78,0x49,0x84,0x24,0xc0,0x03,0x00,0x00]
; EGPR-NEXT: movabsq $64, %rax # encoding: [0x48,0xb8,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
; EGPR-NEXT: tileloadd 3024(%rsp,%rax), %tmm3 # 1024-byte Folded Reload
Expand All @@ -116,7 +116,7 @@ define dso_local void @test1(ptr%buf) nounwind {
; EGPR-NEXT: incl %r14d # encoding: [0x41,0xff,0xc6]
; EGPR-NEXT: cmpw $100, %r14w # encoding: [0x66,0x41,0x83,0xfe,0x64]
; EGPR-NEXT: jl .LBB0_2 # encoding: [0x7c,A]
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_2-1, kind: FK_PCRel_1
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_2, kind: FK_PCRel_1
; EGPR-NEXT: .LBB0_3: # %exit
; EGPR-NEXT: addq $4056, %rsp # encoding: [0x48,0x81,0xc4,0xd8,0x0f,0x00,0x00]
; EGPR-NEXT: # imm = 0xFD8
Expand Down Expand Up @@ -226,7 +226,7 @@ define dso_local void @test2(ptr%buf) nounwind {
; EGPR-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
; EGPR-NEXT: testb %al, %al # encoding: [0x84,0xc0]
; EGPR-NEXT: jne .LBB1_3 # encoding: [0x75,A]
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_3-1, kind: FK_PCRel_1
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_3, kind: FK_PCRel_1
; EGPR-NEXT: # %bb.1: # %loop.header.preheader
; EGPR-NEXT: movq %rdi, %rbx # encoding: [0x48,0x89,0xfb]
; EGPR-NEXT: xorl %r14d, %r14d # encoding: [0x45,0x31,0xf6]
Expand All @@ -237,7 +237,7 @@ define dso_local void @test2(ptr%buf) nounwind {
; EGPR-NEXT: tilezero %tmm0 # encoding: [0xc4,0xe2,0x7b,0x49,0xc0]
; EGPR-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
; EGPR-NEXT: callq foo # encoding: [0xe8,A,A,A,A]
; EGPR-NEXT: # fixup A - offset: 1, value: foo-4, kind: reloc_branch_4byte_pcrel
; EGPR-NEXT: # fixup A - offset: 1, value: foo, kind: reloc_branch_4byte_pcrel
; EGPR-NEXT: ldtilecfg {{[0-9]+}}(%rsp) # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x78,0x49,0x44,0x24,0x08]
; EGPR-NEXT: tilezero %tmm2 # encoding: [0xc4,0xe2,0x7b,0x49,0xd0]
; EGPR-NEXT: tileloadd (%rbx,%r15), %tmm0 # EVEX TO VEX Compression encoding: [0xc4,0xa2,0x7b,0x4b,0x04,0x3b]
Expand All @@ -247,7 +247,7 @@ define dso_local void @test2(ptr%buf) nounwind {
; EGPR-NEXT: incl %r14d # encoding: [0x41,0xff,0xc6]
; EGPR-NEXT: cmpw $100, %r14w # encoding: [0x66,0x41,0x83,0xfe,0x64]
; EGPR-NEXT: jl .LBB1_2 # encoding: [0x7c,A]
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_2-1, kind: FK_PCRel_1
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_2, kind: FK_PCRel_1
; EGPR-NEXT: .LBB1_3: # %exit
; EGPR-NEXT: addq $72, %rsp # encoding: [0x48,0x83,0xc4,0x48]
; EGPR-NEXT: popq %rbx # encoding: [0x5b]
Expand Down
14 changes: 7 additions & 7 deletions llvm/test/CodeGen/X86/AMX/amx-spill-merge.ll
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ define dso_local void @test_api(i16 signext %0, i16 signext %1) nounwind {
; EGPR-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
; EGPR-NEXT: testb %al, %al # encoding: [0x84,0xc0]
; EGPR-NEXT: jne .LBB0_2 # encoding: [0x75,A]
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_2-1, kind: FK_PCRel_1
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_2, kind: FK_PCRel_1
; EGPR-NEXT: # %bb.1: # %if.true
; EGPR-NEXT: movl $buf, %eax # encoding: [0xb8,A,A,A,A]
; EGPR-NEXT: # fixup A - offset: 1, value: buf, kind: FK_Data_4
Expand All @@ -143,13 +143,13 @@ define dso_local void @test_api(i16 signext %0, i16 signext %1) nounwind {
; EGPR-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
; EGPR-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
; EGPR-NEXT: callq foo # encoding: [0xe8,A,A,A,A]
; EGPR-NEXT: # fixup A - offset: 1, value: foo-4, kind: reloc_branch_4byte_pcrel
; EGPR-NEXT: # fixup A - offset: 1, value: foo, kind: reloc_branch_4byte_pcrel
; EGPR-NEXT: ldtilecfg (%rsp) # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x78,0x49,0x04,0x24]
; EGPR-NEXT: movabsq $64, %rax # encoding: [0x48,0xb8,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
; EGPR-NEXT: tileloadd 64(%rsp,%rax), %tmm6 # 1024-byte Folded Reload
; EGPR-NEXT: # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7b,0x4b,0x74,0x04,0x40]
; EGPR-NEXT: jmp .LBB0_3 # encoding: [0xeb,A]
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_3-1, kind: FK_PCRel_1
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_3, kind: FK_PCRel_1
; EGPR-NEXT: .LBB0_2: # %if.false
; EGPR-NEXT: movl $buf, %eax # encoding: [0xb8,A,A,A,A]
; EGPR-NEXT: # fixup A - offset: 1, value: buf, kind: FK_Data_4
Expand All @@ -167,7 +167,7 @@ define dso_local void @test_api(i16 signext %0, i16 signext %1) nounwind {
; EGPR-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
; EGPR-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
; EGPR-NEXT: callq foo # encoding: [0xe8,A,A,A,A]
; EGPR-NEXT: # fixup A - offset: 1, value: foo-4, kind: reloc_branch_4byte_pcrel
; EGPR-NEXT: # fixup A - offset: 1, value: foo, kind: reloc_branch_4byte_pcrel
; EGPR-NEXT: ldtilecfg (%rsp) # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x78,0x49,0x04,0x24]
; EGPR-NEXT: movabsq $64, %rax # encoding: [0x48,0xb8,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
; EGPR-NEXT: tileloadd 64(%rsp,%rax), %tmm6 # 1024-byte Folded Reload
Expand Down Expand Up @@ -294,7 +294,7 @@ define dso_local void @test3(ptr%buf) nounwind {
; EGPR-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
; EGPR-NEXT: testb %al, %al # encoding: [0x84,0xc0]
; EGPR-NEXT: jne .LBB1_3 # encoding: [0x75,A]
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_3-1, kind: FK_PCRel_1
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_3, kind: FK_PCRel_1
; EGPR-NEXT: # %bb.1: # %loop.header.preheader
; EGPR-NEXT: movq %rdi, %rbx # encoding: [0x48,0x89,0xfb]
; EGPR-NEXT: movl $32, %r14d # encoding: [0x41,0xbe,0x20,0x00,0x00,0x00]
Expand All @@ -307,7 +307,7 @@ define dso_local void @test3(ptr%buf) nounwind {
; EGPR-NEXT: tilezero %tmm0 # encoding: [0xc4,0xe2,0x7b,0x49,0xc0]
; EGPR-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
; EGPR-NEXT: callq foo # encoding: [0xe8,A,A,A,A]
; EGPR-NEXT: # fixup A - offset: 1, value: foo-4, kind: reloc_branch_4byte_pcrel
; EGPR-NEXT: # fixup A - offset: 1, value: foo, kind: reloc_branch_4byte_pcrel
; EGPR-NEXT: ldtilecfg {{[0-9]+}}(%rsp) # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x78,0x49,0x44,0x24,0x08]
; EGPR-NEXT: tilezero %tmm0 # encoding: [0xc4,0xe2,0x7b,0x49,0xc0]
; EGPR-NEXT: tileloadd (%rbx,%r14), %tmm1 # EVEX TO VEX Compression encoding: [0xc4,0xa2,0x7b,0x4b,0x0c,0x33]
Expand All @@ -318,7 +318,7 @@ define dso_local void @test3(ptr%buf) nounwind {
; EGPR-NEXT: incl %r15d # encoding: [0x41,0xff,0xc7]
; EGPR-NEXT: cmpw $100, %r15w # encoding: [0x66,0x41,0x83,0xff,0x64]
; EGPR-NEXT: jl .LBB1_2 # encoding: [0x7c,A]
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_2-1, kind: FK_PCRel_1
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_2, kind: FK_PCRel_1
; EGPR-NEXT: .LBB1_3: # %exit
; EGPR-NEXT: addq $72, %rsp # encoding: [0x48,0x83,0xc4,0x48]
; EGPR-NEXT: popq %rbx # encoding: [0x5b]
Expand Down
16 changes: 8 additions & 8 deletions llvm/test/CodeGen/X86/absolute-cmp.ll
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ define void @foo8(i64 %val) {
; NOPIC-NEXT: cmpq $cmp8@ABS8, %rdi # encoding: [0x48,0x83,0xff,A]
; NOPIC-NEXT: # fixup A - offset: 3, value: cmp8@ABS8, kind: FK_Data_1
; NOPIC-NEXT: ja .LBB0_2 # encoding: [0x77,A]
; NOPIC-NEXT: # fixup A - offset: 1, value: .LBB0_2-1, kind: FK_PCRel_1
; NOPIC-NEXT: # fixup A - offset: 1, value: .LBB0_2, kind: FK_PCRel_1
; NOPIC-NEXT: # %bb.1: # %t
; NOPIC-NEXT: pushq %rax # encoding: [0x50]
; NOPIC-NEXT: .cfi_def_cfa_offset 16
; NOPIC-NEXT: callq f@PLT # encoding: [0xe8,A,A,A,A]
; NOPIC-NEXT: # fixup A - offset: 1, value: f@PLT-4, kind: FK_PCRel_4
; NOPIC-NEXT: # fixup A - offset: 1, value: f@PLT, kind: FK_PCRel_4
; NOPIC-NEXT: popq %rax # encoding: [0x58]
; NOPIC-NEXT: .cfi_def_cfa_offset 8
; NOPIC-NEXT: .LBB0_2: # %f
Expand All @@ -32,12 +32,12 @@ define void @foo8(i64 %val) {
; PIC-NEXT: cmpq $cmp8@ABS8, %rdi # encoding: [0x48,0x83,0xff,A]
; PIC-NEXT: # fixup A - offset: 3, value: cmp8@ABS8, kind: FK_Data_1
; PIC-NEXT: ja .LBB0_2 # encoding: [0x77,A]
; PIC-NEXT: # fixup A - offset: 1, value: .LBB0_2-1, kind: FK_PCRel_1
; PIC-NEXT: # fixup A - offset: 1, value: .LBB0_2, kind: FK_PCRel_1
; PIC-NEXT: # %bb.1: # %t
; PIC-NEXT: pushq %rax # encoding: [0x50]
; PIC-NEXT: .cfi_def_cfa_offset 16
; PIC-NEXT: callq f@PLT # encoding: [0xe8,A,A,A,A]
; PIC-NEXT: # fixup A - offset: 1, value: f@PLT-4, kind: FK_PCRel_4
; PIC-NEXT: # fixup A - offset: 1, value: f@PLT, kind: FK_PCRel_4
; PIC-NEXT: popq %rax # encoding: [0x58]
; PIC-NEXT: .cfi_def_cfa_offset 8
; PIC-NEXT: .LBB0_2: # %f
Expand All @@ -59,12 +59,12 @@ define void @foo32(i64 %val) {
; NOPIC-NEXT: cmpq $cmp32, %rdi # encoding: [0x48,0x81,0xff,A,A,A,A]
; NOPIC-NEXT: # fixup A - offset: 3, value: cmp32, kind: reloc_signed_4byte
; NOPIC-NEXT: ja .LBB1_2 # encoding: [0x77,A]
; NOPIC-NEXT: # fixup A - offset: 1, value: .LBB1_2-1, kind: FK_PCRel_1
; NOPIC-NEXT: # fixup A - offset: 1, value: .LBB1_2, kind: FK_PCRel_1
; NOPIC-NEXT: # %bb.1: # %t
; NOPIC-NEXT: pushq %rax # encoding: [0x50]
; NOPIC-NEXT: .cfi_def_cfa_offset 16
; NOPIC-NEXT: callq f@PLT # encoding: [0xe8,A,A,A,A]
; NOPIC-NEXT: # fixup A - offset: 1, value: f@PLT-4, kind: FK_PCRel_4
; NOPIC-NEXT: # fixup A - offset: 1, value: f@PLT, kind: FK_PCRel_4
; NOPIC-NEXT: popq %rax # encoding: [0x58]
; NOPIC-NEXT: .cfi_def_cfa_offset 8
; NOPIC-NEXT: .LBB1_2: # %f
Expand All @@ -75,12 +75,12 @@ define void @foo32(i64 %val) {
; PIC-NEXT: cmpq $cmp32, %rdi # encoding: [0x48,0x81,0xff,A,A,A,A]
; PIC-NEXT: # fixup A - offset: 3, value: cmp32, kind: reloc_signed_4byte
; PIC-NEXT: ja .LBB1_2 # encoding: [0x77,A]
; PIC-NEXT: # fixup A - offset: 1, value: .LBB1_2-1, kind: FK_PCRel_1
; PIC-NEXT: # fixup A - offset: 1, value: .LBB1_2, kind: FK_PCRel_1
; PIC-NEXT: # %bb.1: # %t
; PIC-NEXT: pushq %rax # encoding: [0x50]
; PIC-NEXT: .cfi_def_cfa_offset 16
; PIC-NEXT: callq f@PLT # encoding: [0xe8,A,A,A,A]
; PIC-NEXT: # fixup A - offset: 1, value: f@PLT-4, kind: FK_PCRel_4
; PIC-NEXT: # fixup A - offset: 1, value: f@PLT, kind: FK_PCRel_4
; PIC-NEXT: popq %rax # encoding: [0x58]
; PIC-NEXT: .cfi_def_cfa_offset 8
; PIC-NEXT: .LBB1_2: # %f
Expand Down
Loading
Loading