llvm-project/clang/test/CodeGen/SystemZ
Fangrui Song 37561ba89b -fno-semantic-interposition: Don't set dso_local on GlobalVariable
`clang -fpic -fno-semantic-interposition` may set dso_local on variables for -fpic.

GCC folks consider there are 'address interposition' and 'semantic interposition',
and 'disabling semantic interposition' can optimize function calls but
cannot change variable references to use local aliases
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100483).

This patch removes dso_local for variables in
`clang -fpic -fno-semantic-interposition` mode so that the built shared objects can
work with copy relocations. Building llvm-project tiself with
-fno-semantic-interposition (D102453) should now be safe with trunk Clang.

Example:
```
// a.c
int var;
int *addr() { return var; }

// old: cannot be interposed
movslq  .Lvar$local(%rip), %rax
// new: can be interposed
movq    var@GOTPCREL(%rip), %rax
movslq  (%rax), %rax
```

The local alias lowering for `GlobalVariable`s is kept in case there is a
future option allowing local aliases.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D102583
2021-05-19 16:08:28 -07:00
..
align-systemz.c [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
builtins-systemz-error.c
builtins-systemz-error2.c
builtins-systemz-vector-constrained.c
builtins-systemz-vector-error.c
builtins-systemz-vector.c
builtins-systemz-vector2-constrained.c
builtins-systemz-vector2-error.c
builtins-systemz-vector2.c
builtins-systemz-vector3-error.c
builtins-systemz-vector3.c
builtins-systemz-zvector-constrained.c -fno-semantic-interposition: Don't set dso_local on GlobalVariable 2021-05-19 16:08:28 -07:00
builtins-systemz-zvector-error.c
builtins-systemz-zvector.c [IR] Let IRBuilder's CreateVectorSplat/CreateShuffleVector use poison as placeholder 2020-12-30 04:21:04 +09:00
builtins-systemz-zvector2-constrained.c [IR] Let IRBuilder's CreateVectorSplat/CreateShuffleVector use poison as placeholder 2020-12-30 04:21:04 +09:00
builtins-systemz-zvector2-error.c
builtins-systemz-zvector2.c [IR] Let IRBuilder's CreateVectorSplat/CreateShuffleVector use poison as placeholder 2020-12-30 04:21:04 +09:00
builtins-systemz-zvector3-constrained.c
builtins-systemz-zvector3-error.c
builtins-systemz-zvector3.c
builtins-systemz.c
mbackchain-2.c
mbackchain-3.c
mbackchain.c [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
s390x-packed-struct-func-arg.c
strictfp_builtins.c [SystemZ] Test for isinf and isfinite in testFPKind(). 2021-03-15 15:02:39 -06:00
systemz-abi-vector.c [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
systemz-abi.c [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
systemz-abi.cpp [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
systemz-inline-asm-02.c
systemz-inline-asm.c [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
zos-alignment.c [NFC] clang-formatting zos-alignment.c 2021-03-29 16:48:10 -04:00
zvector.c [test] Add {{.*}} to make ELF tests immune to dso_local/dso_preemptable/(none) differences 2020-12-31 00:27:11 -08:00
zvector2.c