forked from OSchip/llvm-project
parent
d5a97fc683
commit
baadbd554a
|
@ -581,7 +581,16 @@ void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm,
|
|||
unsigned Type;
|
||||
if (Is64Bit) {
|
||||
if (IsPCRel) {
|
||||
Type = ELF::R_X86_64_PC32;
|
||||
switch (Modifier) {
|
||||
case MCSymbolRefExpr::VK_None:
|
||||
Type = ELF::R_X86_64_PC32;
|
||||
break;
|
||||
case MCSymbolRefExpr::VK_PLT:
|
||||
Type = ELF::R_X86_64_PLT32;
|
||||
break;
|
||||
default:
|
||||
llvm_unreachable("Unimplemented");
|
||||
}
|
||||
} else {
|
||||
switch ((unsigned)Fixup.getKind()) {
|
||||
default: llvm_unreachable("invalid fixup kind!");
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck %s
|
||||
|
||||
// Test that this produces a R_X86_64_PLT32.
|
||||
|
||||
jmp foo@PLT
|
||||
|
||||
// CHECK: ('_relocations', [
|
||||
// CHECK-NEXT: # Relocation 0
|
||||
// CHECK-NEXT: (('r_offset',
|
||||
// CHECK-NEXT: ('r_sym',
|
||||
// CHECK-NEXT: ('r_type', 4)
|
||||
// CHECK-NEXT: ('r_addend',
|
||||
// CHECK-NEXT: ),
|
||||
// CHECK-NEXT: ])
|
Loading…
Reference in New Issue