[PATCH] D69004: Use portable flag with nm in extract_symbols.py

David Tenty via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 23 13:50:46 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rGbf869683c3f2: Use portable flag with nm in extract_symbols.py (authored by daltenty).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69004/new/

https://reviews.llvm.org/D69004

Files:
  llvm/utils/extract_symbols.py


Index: llvm/utils/extract_symbols.py
===================================================================
--- llvm/utils/extract_symbols.py
+++ llvm/utils/extract_symbols.py
@@ -42,13 +42,13 @@
     process.wait()
 
 def nm_get_symbols(lib):
-    process = subprocess.Popen(['nm',lib], bufsize=1,
+    process = subprocess.Popen(['nm','-P',lib], bufsize=1,
                                stdout=subprocess.PIPE, stdin=subprocess.PIPE,
                                universal_newlines=True)
     process.stdin.close()
     for line in process.stdout:
         # Look for external symbols that are defined in some section
-        match = re.match("^\S+\s+[BDGRSTVW]\s+(\S+)$", line)
+        match = re.match("^(\S+)\s+[BDGRSTVW]\s+\S+\s+\S+$", line)
         if match:
             yield match.group(1)
     process.wait()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69004.226179.patch
Type: text/x-patch
Size: 825 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191023/a72d38ac/attachment.bin>


More information about the llvm-commits mailing list