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
..
2019-06-07 13:00:17 +00:00
2019-06-07 13:00:17 +00:00
2019-06-07 13:00:17 +00:00
2019-06-07 13:00:17 +00:00
2019-06-07 13:00:17 +00:00
2019-06-07 13:00:17 +00:00
2019-06-07 13:00:17 +00:00
2019-06-07 13:00:17 +00:00
2019-06-07 13:00:17 +00:00
2019-06-07 13:00:17 +00:00
2019-06-07 13:00:17 +00:00
2017-10-24 19:05:32 +00:00
2017-10-24 19:05:32 +00:00
2016-12-14 10:36:12 +00:00
2016-10-10 09:39:26 +00:00
2018-03-29 22:43:52 +00:00
2016-12-08 12:58:55 +00:00
2016-09-23 13:54:48 +00:00
2018-07-31 13:41:59 +00:00
2018-07-31 13:41:59 +00:00
2018-07-31 13:41:59 +00:00
2018-07-31 13:41:59 +00:00
2018-01-23 16:59:20 +00:00
2020-02-28 22:23:14 -08:00
2019-06-26 08:09:08 +00:00
2016-09-29 10:27:10 +00:00
2018-01-08 10:17:03 +00:00
2018-03-22 17:14:41 +00:00
2019-09-10 12:28:07 +00:00
2019-09-16 07:05:34 +00:00
2017-10-30 17:43:16 +00:00
2019-09-16 07:05:34 +00:00
2018-06-11 19:42:57 +00:00
2020-03-25 23:34:46 -07:00
2017-10-05 23:28:29 +00:00
2017-07-17 20:42:52 +00:00
2017-07-17 20:42:52 +00:00
2017-07-17 20:42:52 +00:00
2017-06-28 09:51:33 +00:00
2019-03-18 15:32:57 +00:00
2017-09-08 18:41:49 +00:00
2020-02-19 22:01:42 -08:00
2017-09-28 17:15:02 +00:00
2020-04-20 12:48:57 -07:00
2018-02-16 20:23:54 +00:00
2020-04-18 08:19:45 -07:00
2020-04-18 08:19:45 -07:00
2017-11-28 20:17:58 +00:00
2017-11-23 23:40:33 +00:00
2018-12-22 00:31:05 +00:00
2019-07-16 05:50:45 +00:00
2020-07-09 19:15:31 +07:00
2019-02-13 21:49:55 +00:00
2019-02-13 21:49:55 +00:00
2019-02-13 21:49:55 +00:00
2019-09-09 03:35:14 +00:00
2018-09-28 14:09:16 +00:00
2018-06-13 18:45:25 +00:00
2018-01-16 19:02:46 +00:00
2018-01-16 18:53:09 +00:00
2019-06-05 03:04:46 +00:00
2019-06-05 03:04:46 +00:00
2019-06-05 03:04:46 +00:00
2019-06-05 03:04:46 +00:00
2017-04-08 06:14:14 +00:00
2018-09-11 23:00:36 +00:00
2018-03-14 18:08:33 +00:00
2019-02-06 14:43:30 +00:00
2019-02-06 14:43:30 +00:00
2019-02-06 14:43:30 +00:00
2016-12-06 12:19:24 +00:00
2018-07-31 13:55:25 +00:00
2017-01-20 04:58:12 +00:00
2017-06-12 00:05:54 +00:00
2017-06-12 00:05:54 +00:00
2017-06-12 00:05:54 +00:00
2017-06-12 00:05:54 +00:00
2016-12-02 17:23:58 +00:00
2018-07-18 22:49:31 +00:00
2017-12-14 05:01:49 +00:00
2018-03-14 21:18:18 +00:00
2017-12-06 08:36:21 +00:00
2018-07-24 05:40:37 +00:00
2016-12-21 05:31:57 +00:00
2016-09-29 12:58:42 +00:00
2016-09-29 12:58:42 +00:00
2016-09-29 12:58:48 +00:00
2018-02-07 10:02:49 +00:00
2018-02-07 10:02:49 +00:00
2018-06-11 07:24:31 +00:00
2018-06-11 07:24:31 +00:00
2018-05-08 15:34:06 +00:00
2017-09-12 13:08:24 +00:00
2018-05-08 15:34:06 +00:00
2018-03-23 00:35:27 +00:00
2018-10-03 21:58:42 +00:00
2020-07-10 07:23:32 -05:00
2018-04-27 15:41:19 +00:00
2018-04-27 15:41:19 +00:00
2018-04-23 15:01:24 +00:00
2020-08-17 09:36:09 -05:00
2018-10-16 17:13:01 +00:00
2019-01-24 18:17:40 +00:00
2019-01-24 18:17:40 +00:00
2020-02-19 22:01:42 -08:00
2018-08-21 15:13:53 +00:00
2018-06-01 15:20:56 +00:00
2019-05-07 04:26:05 +00:00
2019-05-07 04:26:05 +00:00
2018-09-20 00:26:44 +00:00
2019-02-11 21:38:20 +00:00
2018-01-10 01:37:36 +00:00
2017-06-06 06:38:32 +00:00
2017-02-23 06:22:28 +00:00
2016-11-15 08:19:02 +00:00
2019-09-10 12:28:07 +00:00
2017-01-10 01:21:50 +00:00
2016-11-15 08:07:14 +00:00
2017-01-19 19:51:02 +00:00
2017-05-26 19:12:38 +00:00
2020-08-11 15:14:33 +03:00
2017-11-24 06:42:32 +00:00
2018-05-04 15:09:49 +00:00
2019-10-01 16:10:13 +00:00
2020-03-06 13:59:58 +03:00
2017-12-30 08:00:44 +00:00
2017-06-12 18:46:33 +00:00
2017-06-12 18:46:33 +00:00
2018-02-14 13:36:22 +00:00
2018-02-14 13:36:22 +00:00
2017-07-19 16:45:05 +00:00
2017-07-19 16:45:05 +00:00
2020-04-02 01:21:36 +09:00
2018-03-22 17:14:41 +00:00
2018-01-16 18:21:23 +00:00
2017-10-11 18:37:24 +00:00
2017-01-11 08:29:52 +00:00
2016-10-06 09:45:04 +00:00
2017-07-19 18:24:38 +00:00
2017-10-04 09:46:53 +00:00
2017-10-04 09:46:53 +00:00
2017-07-12 17:49:17 +00:00
2017-07-12 11:09:46 +00:00
2018-05-14 10:13:56 +00:00
2019-07-17 14:54:02 +00:00
2019-08-09 08:29:03 +00:00
2017-09-13 00:47:06 +00:00
2017-07-05 00:43:18 +00:00
2017-10-13 00:06:38 +00:00
2017-10-06 20:09:34 +00:00
2019-01-02 19:28:00 +00:00
2017-11-28 23:06:09 +00:00
2017-12-24 19:02:10 +00:00
2019-06-05 03:04:46 +00:00
2019-06-05 03:04:46 +00:00
2019-06-05 03:04:46 +00:00
2019-06-05 03:04:46 +00:00
2019-02-07 18:12:57 +00:00
2018-08-02 18:13:40 +00:00
2018-07-17 23:16:02 +00:00
2017-12-28 00:23:49 +00:00
2017-12-27 20:53:13 +00:00
2017-12-23 09:00:37 +00:00
2018-03-01 23:01:41 +00:00