X86: Don't make illegal GOTTPOFF relocations
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 6 Jan 2015 07:12:52 +0000 (07:12 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 6 Jan 2015 07:12:52 +0000 (07:12 +0000)
commitb3065539bdb1e7e82406ae6b20a9241f991757eb
tree57e7b0c17fce72e7079d4e345e0bb9c2a9ba39b0
parent7a7ed3cec2651096f89aa4e80284f1f0a02a2ae3
X86: Don't make illegal GOTTPOFF relocations

"ELF Handling for Thread-Local Storage" specifies that R_X86_64_GOTTPOFF
relocation target a movq or addq instruction.

Prohibit the truncation of such loads to movl or addl.

This fixes PR22083.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225250 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
test/CodeGen/X86/tls-models.ll