[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
Tue Dec 20 06:41:22 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0de9fd1c2790: [libc++] accept ELF Tool Chain readelf format in tooling (authored by emaste).

Repository:
  rG LLVM Github Monorepo

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.484250.patch
Type: text/x-patch
Size: 1086 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221220/facf07b1/attachment.bin>


More information about the libcxx-commits mailing list