Don't create a plt when LD access is optimized.

llvm-svn: 265203
This commit is contained in:
Rafael Espindola 2016-04-02 00:19:22 +00:00
parent cf3b04dab9
commit 059f3fb8fb
2 changed files with 11 additions and 1 deletions

View File

@ -279,7 +279,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body,
InputSectionBase<ELFT> &C, RelT &RI) {
if (Target->pointsToLocalDynamicGotEntry(Type)) {
if (Target->canRelaxTls(Type, nullptr))
return 1;
return 2;
if (Out<ELFT>::Got->addTlsIndex())
Out<ELFT>::RelaDyn->addReloc({Target->TlsModuleIndexRel,
DynamicReloc<ELFT>::Off_LTlsIndex,

View File

@ -15,6 +15,16 @@ _start:
rex64
callq __tls_get_addr@PLT
leaq bar@TLSLD(%rip), %rdi
callq __tls_get_addr@PLT
leaq bar@DTPOFF(%rax), %rax
.type bar,@object
.section .tdata,"awT",@progbits
.align 8
bar:
.long 42
.type foo,@object
.section .tdata,"awT",@progbits