diff mbox series

libbacktrace patch committed: Don't fail if symbol size is unknown

Message ID CAOyqgcW1S6wiQLKUhFS5YbLymccKxgOKGyt2dLtS9F87LZB+qQ@mail.gmail.com
State New
Headers show
Series libbacktrace patch committed: Don't fail if symbol size is unknown | expand

Commit Message

Ian Lance Taylor July 12, 2024, 1 a.m. UTC
Mach-O and PE/COFF don't record symbol sizes in the symbol table.
Adjust the libbacktrace testsuite so that it doesn't fail if the
symbol size is unknown, only if it is incorrect.  Ran libbacktrace
tests on macOS on the compile farm and on x86_64-pc-linux-gnu.
Committed to mainline.

Ian

            * btest.c (test5): Don't fail if symbol size is 0.
            * mtest.c (test5): Likewise.
d7318f4cf89c2a934fcd1f87d711081285fad242
diff mbox series

Patch

diff --git a/libbacktrace/btest.c b/libbacktrace/btest.c
index c4b2db2cce2..3b603f643fa 100644
--- a/libbacktrace/btest.c
+++ b/libbacktrace/btest.c
@@ -440,7 +440,7 @@  test5 (void)
 		   (unsigned long) (uintptr_t) &global);
 	  symdata.failed = 1;
 	}
-      else if (symdata.size != sizeof (global))
+      else if (symdata.size != sizeof (global) && symdata.size != 0)
 	{
 	  fprintf (stderr,
 		   "test5: unexpected syminfo size got %lx expected %lx\n",
diff --git a/libbacktrace/mtest.c b/libbacktrace/mtest.c
index f793391653d..5ec43c7bbce 100644
--- a/libbacktrace/mtest.c
+++ b/libbacktrace/mtest.c
@@ -373,7 +373,7 @@  test5 (void)
 		   (unsigned long) (uintptr_t) &global);
 	  symdata.failed = 1;
 	}
-      else if (symdata.size != sizeof (global))
+      else if (symdata.size != sizeof (global) && symdata.size != 0)
 	{
 	  fprintf (stderr,
 		   "test5: unexpected syminfo size got %lx expected %lx\n",