This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

backtrace for hppa


As far as I can tell, the only architecture in glibc that uses the generic 
debug/backtrace.c is hppa.  
<https://sourceware.org/glibc/wiki/Release/2.26#HPPA> also shows the 
debug/tst-backtrace* tests as failing for hppa.  That suggests the generic 
debug/backtrace.c is not in fact functional anywhere and so the x86_64 
backtrace implementation (which many other architectures include) would be 
a better generic version.

(a) Could someone confirm that those backtrace tests are indeed still 
failing for hppa with current master?  If so, a bug should be filed in 
Bugzilla for this.

(b) Does the following patch change the results for hppa?  This is simply 
the completely mechanical use of the x86_64 version as if it were the 
default (adjusted to avoid hardcoding libgcc_s.so.1, since hppa uses 
libgcc_s.so.4); I haven't tested it at all, even to see if it compiles.

(Even if this patch doesn't help backtrace results for hppa, that only 
indicates an hppa-specific version of backtrace is needed, not that the 
generic one is a useful default.)

diff --git a/sysdeps/hppa/backtrace.c b/sysdeps/hppa/backtrace.c
new file mode 100644
index 0000000..27ce597
--- /dev/null
+++ b/sysdeps/hppa/backtrace.c
@@ -0,0 +1 @@
+#include <sysdeps/x86_64/backtrace.c>
diff --git a/sysdeps/x86_64/backtrace.c b/sysdeps/x86_64/backtrace.c
index 2706b50..d423cc0 100644
--- a/sysdeps/x86_64/backtrace.c
+++ b/sysdeps/x86_64/backtrace.c
@@ -20,6 +20,7 @@
 #include <libc-lock.h>
 #include <dlfcn.h>
 #include <execinfo.h>
+#include <gnu/lib-names.h>
 #include <stdlib.h>
 #include <unwind.h>
 
@@ -49,7 +50,7 @@ dummy_getcfa (struct _Unwind_Context *ctx __attribute__ ((unused)))
 static void
 init (void)
 {
-  libgcc_handle = __libc_dlopen ("libgcc_s.so.1");
+  libgcc_handle = __libc_dlopen (LIBGCC_S_SO);
 
   if (libgcc_handle == NULL)
     return;

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]