[libcxx-commits] [PATCH] D140313: libcxx: accept both GNU and ELF Tool Chain readelf format

Ed Maste via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 19 15:48:01 PST 2022


emaste updated this revision to Diff 484122.
emaste edited the summary of this revision.
Herald added a subscriber: krytarowski.

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

https://reviews.llvm.org/D140313

Files:
  libcxx/utils/libcxx/sym_check/extract.py


Index: libcxx/utils/libcxx/sym_check/extract.py
===================================================================
--- libcxx/utils/libcxx/sym_check/extract.py
+++ libcxx/utils/libcxx/sym_check/extract.py
@@ -175,10 +175,16 @@
         start = -1
         end = -1
         for i in range(len(lines)):
-            if lines[i].startswith("Symbol table '.dynsym'"):
+            # Accept both GNU and ELF Tool Chain readelf format.  Some versions
+            # of ELF Tool Chain readelf use ( ) around the symbol table name
+            # instead of ' ', and omit the blank line before the heading.
+            if re.match(r"Symbol table ['(].dynsym[')]", lines[i]):
                 start = i + 2
-            if start != -1 and end == -1 and not lines[i].strip():
-                end = i + 1
+            elif start != -1 and end == -1:
+                if not lines[i].strip():
+                    end = i + 1
+                if lines[i].startswith("Symbol table ("):
+                    end = i
         assert start != -1
         if end == -1:
             end = len(lines)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140313.484122.patch
Type: text/x-patch
Size: 1086 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221219/fd268384/attachment.bin>


More information about the libcxx-commits mailing list