[llvm] [PowerPC] Support local-dynamic TLS relocation on AIX (PR #66316)

Felix via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 00:00:32 PDT 2023


orcguru wrote:

I saw comments being folded, paste here for notice, sorry about the duplication:

So I did have another version which can essentially remove the assert check with some side effects:

(1) It did generated extra external symbol reference, which looks like no harm with simple HelloWorld. (Notice: xlC does not generate this symbol reference.)
```
        .extern _Renamed..5f24__TLSML[UA]
        .rename _Renamed..5f24__TLSML[UA],"_$TLSML"
```
(2) Inside `XCOFFObjectWriter::recordRelocation()` logic I have to apply a hack to get the correct symbol, because now there are two symbols: one is `_Renamed..5f24__TLSML[UA]`, the other is `_Renamed..5f24__TLSML[TC]`. Without hack it will choose the [UA] one which will cause linker failure.

Attached the draft patch: [ReplaceAssertHack.diff.txt](https://github.com/llvm/llvm-project/files/12723368/ReplaceAssertHack.diff.txt)

I think current version has the advantage that it does not generate any extra external symbol reference or any extra relocation entry, although it looks ugly with regard to those asserts.

Is it possible that we fix the hack implementation with some future version (I will open an issue and work on it afterwards)? How about let's move on with current approach?

@amy-kwan @stephenpeckham @bzEq @chenzheng1030 Appreciate your comments. Thank you!

https://github.com/llvm/llvm-project/pull/66316


More information about the llvm-commits mailing list