Skip to content

Commit ff1d920

Browse files
Jinsong Jimemfrob
authored andcommitted
[AIX] Include symbol alias in extract_symbols.py
nm does not show size for aliased symbols, we should still extract them if they are external. Reviewed By: hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D107112
1 parent d366287 commit ff1d920

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

llvm/utils/extract_symbols.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ def nm_get_symbols(lib):
5353
process.stdin.close()
5454
for line in process.stdout:
5555
# Look for external symbols that are defined in some section
56-
match = re.match("^(\S+)\s+[BDGRSTVW]\s+\S+\s+\S+$", line)
56+
# The POSIX format is:
57+
# name type value size
58+
# The -P flag displays the size field for symbols only when applicable,
59+
# so the last field is optional. There's no space after the value field,
60+
# but \s+ match newline also, so \s+\S* will match the optional size field.
61+
match = re.match("^(\S+)\s+[BDGRSTVW]\s+\S+\s+\S*$", line)
5762
if match:
5863
yield match.group(1)
5964
process.wait()

0 commit comments

Comments
 (0)