Fangrui Song fb3c1b3de5 [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
2020-12-21 08:47:04 -08:00
..
2017-09-28 17:15:02 +00:00
2017-11-28 20:17:58 +00:00
2017-11-23 23:40:33 +00:00
2018-06-13 18:45:25 +00:00
2018-01-16 18:53:09 +00:00
2017-12-14 05:01:49 +00:00
2018-03-23 00:35:27 +00:00
2019-02-11 21:38:20 +00:00
2017-07-19 16:45:05 +00:00
2017-07-19 16:45:05 +00:00
2017-07-05 00:43:18 +00:00
2017-11-28 23:06:09 +00:00