AIX: Consider tdata symbols in ExportImportList

Thread-local variables are put in the tdata section on AIX / XCOFF [1]. Unfortunately
the ExportImportList script currently doesn't consider this section when looking for
symbols to export.

This results in linking failures in applications (such as LLVM) when building which expect these thread local variables to be exported from their shared libraries.

[1]: https://www.ibm.com/docs/en/aix/7.3?topic=formats-xcoff-object-file-format
This commit is contained in:
David Tenty
2024-04-11 12:18:41 -04:00
parent f8ba5b12ca
commit b4d1ab42b8

View File

@@ -63,7 +63,7 @@ if test -z "$no_objects"; then
V["EXPORTED"]=" export"
V["PROTECTED"]=" protected"
}
/^\[[0-9]+\]\tm +[^ ]+ +\.(text|data|bss) +[^ ]+ +(extern|weak) +(EXPORTED|PROTECTED| ) / {
/^\[[0-9]+\]\tm +[^ ]+ +\.(text|data|tdata|bss) +[^ ]+ +(extern|weak) +(EXPORTED|PROTECTED| ) / {
if (!match($NF,/^(\.|__sinit|__sterm|__[0-9]+__)/)) {
print $NF V[$(NF-1)]
}