Blame SOURCES/elfutils-0.176-gcc-pr88835.patch

aa9e71
Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88835
aa9e71
aa9e71
diff --git a/src/readelf.c b/src/readelf.c
aa9e71
index 33706bd..b55844c 100644
aa9e71
--- a/src/readelf.c
aa9e71
+++ b/src/readelf.c
aa9e71
@@ -10143,7 +10143,7 @@ print_debug_str_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
aa9e71
       ++digits;
aa9e71
       tmp >>= 4;
aa9e71
     }
aa9e71
-  digits = MAX (4, digits);
aa9e71
+  digits = MIN (16, MAX (4, digits));
aa9e71
 
aa9e71
   printf (gettext ("\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"
aa9e71
 		   " %*s  String\n"),
aa9e71
diff --git a/tests/backtrace.c b/tests/backtrace.c
aa9e71
index 05e8ef8..d621fbf 100644
aa9e71
--- a/tests/backtrace.c
aa9e71
+++ b/tests/backtrace.c
aa9e71
@@ -185,7 +185,7 @@ frame_callback (Dwfl_Frame *state, void *frame_arg)
aa9e71
     symname = dwfl_module_addrname (mod, pc_adjusted);
aa9e71
 
aa9e71
   printf ("#%2d %#" PRIx64 "%4s\t%s\n", *framenop, (uint64_t) pc,
aa9e71
-	  ! isactivation ? "- 1" : "", symname);
aa9e71
+	  ! isactivation ? "- 1" : "", symname ?: "<null>");
aa9e71
   pid_t tid = dwfl_thread_tid (thread);
aa9e71
   callback_verify (tid, *framenop, pc, symname, dwfl);
aa9e71
   (*framenop)++;