[llvm] [AIX]export function descriptor symbols related to template functions. (PR #101920)
Chen Zheng via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 4 20:39:51 PDT 2024
https://github.com/chenzheng1030 created https://github.com/llvm/llvm-project/pull/101920
This fixes regressions caused by https://github.com/llvm/llvm-project/pull/97526
After that patch, all undefined references to DS symbol are removed. This makes DS symbols(for template functions) have no reference. So extract_symbols.py does not export these DS symbols.
But the logic in extract_symbols.py for referring checking is only for template function symbols. On AIX, function names start with `.`, the symbols without `.` are function descriptors which are data symbols actually. So still need to export these data symbols.
Without this fix, on AIX, we get:
```
rtld: 0712-001 Symbol _ZN4llvm15SmallVectorBaseIjE13mallocForGrowEPvmmRm was referenced
from module llvm-project/build/unittests/Passes/Plugins/TestPlugin.so(), but a runtime definition
of the symbol was not found.
```
>From d879fb6a28b23171784d06846d4850beb583a655 Mon Sep 17 00:00:00 2001
From: Chen Zheng <czhengsz at cn.ibm.com>
Date: Sun, 4 Aug 2024 23:32:05 -0400
Subject: [PATCH] [AIX]export function descriptor symbols related to template
funcionts.
---
llvm/utils/extract_symbols.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/llvm/utils/extract_symbols.py b/llvm/utils/extract_symbols.py
index 10fdf14acd158..19a3066deec73 100755
--- a/llvm/utils/extract_symbols.py
+++ b/llvm/utils/extract_symbols.py
@@ -484,5 +484,9 @@ def parse_tool_path(parser, tool, val):
outfile = sys.stdout
for k, v in list(symbol_defs.items()):
template = get_template_name(k, args.mangling)
+ # On AIX, "template" functions starting with "_" are actually function
+ # descriptors which are data symbols. Export these data symbols.
+ if template and platform.system() == "AIX" and k.startswith("_"):
+ template = None
if v == 1 and (not template or template in template_instantiation_refs):
print(k, file=outfile)
More information about the llvm-commits
mailing list