diff options
| author | Fangrui Song <i@maskray.me> | 2020-12-21 08:47:04 -0800 |
|---|---|---|
| committer | Fangrui Song <i@maskray.me> | 2020-12-21 08:47:04 -0800 |
| commit | fb3c1b3de5ce7342438d7451f01a14f9c52323cd (patch) | |
| tree | ffe6dd7a7bc1fc410b3258ba0ced94568a1591c2 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | |
| parent | e25afcfa51abbd63ddbe943913af1ba61161ab28 (diff) | |
[ELF] Reject local-exec TLS relocations for -shared
For x86-64, D33100 added a diagnostic for local-exec TLS relocations referencing a preemptible symbol.
This patch generalizes it to non-preemptible symbols (see `-Bsymbolic` in `tls.s`)
on all targets.
Local-exec TLS relocations resolve to offsets relative to a fixed point within
the static TLS block, which are only meaningful for the executable.
With this change, `clang -fpic -shared -fuse-ld=bfd a.c` on the following example will be flagged for AArch64/ARM/i386/x86-64/RISC-V
```
static __attribute__((tls_model("local-exec"))) __thread long TlsVar = 42;
long bump() { return ++TlsVar; }
```
Note, in GNU ld, at least arm, riscv and x86's ports have the similar
diagnostics, but aarch64 and ppc64 do not error.
Differential Revision: https://reviews.llvm.org/D93331
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions
