HomePhabricator

Make TLS work for PIE executables on x86-64.

Authored by ed on Apr 5 2016, 1:51 PM.

Description

Make TLS work for PIE executables on x86-64.

While trying to get PIE work on CloudABI for x86-64, I noticed that even
though GNU ld would generate functional binaries, LLD would not. It
turns out that we generate relocations for referencing TLS objects
inside of the text segment, which shouldn't happen.

This change extends the isRelRelative() function to list some additional
relocation types that should be treated as relative. This makes my C
library unit testing binary work on x86-64.

Approved by: ruiu
Differential Revision: http://reviews.llvm.org/D18688
Fixes bug: https://llvm.org/bugs/show_bug.cgi?id=27174

llvm-svn: 265462