Implement ELF::R_X86_64_GOTPCREL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115547 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2010-10-04 19:51:39 +00:00
parent cebdc01d66
commit 607d1f6d32
2 changed files with 11 additions and 1 deletions

View File

@ -588,6 +588,9 @@ void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm,
case MCSymbolRefExpr::VK_PLT:
Type = ELF::R_X86_64_PLT32;
break;
case llvm::MCSymbolRefExpr::VK_GOTPCREL:
Type = ELF::R_X86_64_GOTPCREL;
break;
default:
llvm_unreachable("Unimplemented");
}

View File

@ -2,7 +2,8 @@
// Test that this produces a R_X86_64_GOT32.
movl foo@GOT, %eax
movl foo@GOT, %eax
movl foo@GOTPCREL(%rip), %eax
// CHECK: ('_relocations', [
// CHECK-NEXT: # Relocation 0
@ -11,4 +12,10 @@
// CHECK-NEXT: ('r_type', 3)
// CHECK-NEXT: ('r_addend',
// CHECK-NEXT: ),
// CHECK-NEXT: # Relocation 1
// CHECK-NEXT: (('r_offset',
// CHECK-NEXT: ('r_sym',
// CHECK-NEXT: ('r_type', 9)
// CHECK-NEXT: ('r_addend',
// CHECK-NEXT: ),
// CHECK-NEXT: ])