diff options
author | Fangrui Song <maskray@google.com> | 2019-05-20 11:47:31 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-05-20 11:47:31 +0000 |
commit | 2109572464da69eb96eda27a0fe5735da1405a9c (patch) | |
tree | fa8489b9638356c6f116358e18d6e4b8c2ed344c /llvm/lib/Transforms/Utils/InlineFunction.cpp | |
parent | 3b6b2e331fea16b375d12747f3030c6187e86c2c (diff) | |
download | llvm-2109572464da69eb96eda27a0fe5735da1405a9c.zip llvm-2109572464da69eb96eda27a0fe5735da1405a9c.tar.gz llvm-2109572464da69eb96eda27a0fe5735da1405a9c.tar.bz2 |
[ELF] Fix getRelocTargetVA formulae of R_TLS and R_NEG_TLS
For R_TLS:
1) Delete Sym.isTls() . The assembler ensures the symbol is STT_TLS.
If not (the input is broken), we would crash (dereferencing null Out::TlsPhdr).
2) Change Sym.isUndefWeak() to Sym.isUndefined(), otherwise with --noinhibit-exec
we would still evaluate the symbol and crash.
3) Return A if the symbol is undefined. This is PR40570.
The case is probably unrealistic but returning A matches R_ABS and the
behavior of several dynamic loaders.
R_NEG_TLS is obsoleted Sun TLS we don't fully support, but
R_RELAX_TLS_GD_TO_LE_NEG is still used by GD->LE relaxation (subl $var@tpoff,%eax).
They should add the addend. Unfortunately I can't test it as compilers don't seem to generate non-zero implicit addends.
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D62098
llvm-svn: 361146
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
0 files changed, 0 insertions, 0 deletions