[ELF2] - fix to use PLT/GOT for DSO function calls (X86TargetInfo)

Differential Revision: http://reviews.llvm.org/D13522

llvm-svn: 249588
This commit is contained in:
George Rimar 2015-10-07 18:46:13 +00:00
parent 675f49bbd5
commit 730c27894a
2 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ bool X86TargetInfo::relocPointsToGot(uint32_t Type) const {
}
bool X86TargetInfo::relocNeedsPlt(uint32_t Type, const SymbolBody &S) const {
return Type == R_386_PLT32;
return Type == R_386_PLT32 || (Type == R_386_PC32 && S.isShared());
}
static void add32le(uint8_t *L, int32_t V) { write32le(L, read32le(L) + V); }

View File

@ -62,7 +62,7 @@ R_386_GOTPC:
call bar+4
// CHECK: Disassembly of section .dynamic_reloc:
// CHECK-NEXT: .dynamic_reloc:
// CHECK-NEXT: 12019: e8 00 00 00 00 calll 0
// CHECK-NEXT: 12019: e8 16 00 00 00 calll 22
.section .R_386_GOT32,"ax",@progbits
.global R_386_GOT32