[ELF] -r: don't define _TLS_MODULE_BASE_
authorFangrui Song <i@maskray.me>
Tue, 22 Nov 2022 20:59:45 +0000 (12:59 -0800)
committerFangrui Song <i@maskray.me>
Tue, 22 Nov 2022 20:59:45 +0000 (12:59 -0800)
commit8610cb04605bbae3399972875aef69e5e457a879
tree79131fe0c9c4c88633776835c2467b0f7aec8102
parent2ec79afd89932f0d5a9c44050e7b6dc08ff51699
[ELF] -r: don't define _TLS_MODULE_BASE_

_TLS_MODULE_BASE_ is supposed to be defined by the final link. Defining it in a
relocatable link may render the final link value incorrect.

GNU ld i386/x86-64 have the same issue: https://sourceware.org/bugzilla/show_bug.cgi?id=29820
lld/ELF/Writer.cpp
lld/test/ELF/x86-64-tlsdesc-ld.s