[committed] Fix stack trace on hppa-unknown-linux-gnu

John David Anglin dave@hiauly1.hia.nrc.ca
Sat Aug 20 20:45:00 GMT 2005


The enclosed change fixes stack traces on hppa-unknown-linux-gnu.

The fix for PR libgcj/21692 didn't take into account of the fact
that function descriptors are only used when the plabel bit is set
in a function pointer.  Further, the least significant two bits
of the function pointer need to be zeroed before using the pointer
to access the function descriptor.

Unfortunately, the change only fixes half the PR fails.  We are
still left with the gij fails.  For example,

byte compile: /home/dave/gnu/gcc-4.0/objdir/gcc/gcj -B/home/dave/gnu/gcc-4.0/objdir/gcc/ --encoding=UTF-8 -C -I/home/dave/gnu/gcc-4.0/objdir/hppa-linux/libjava/testsuite/../libgcj-4.1.0.jar -g /home/dave/gnu/gcc-4.0/gcc/libjava/testsuite/libjava.lang/Class_1.java -d /home/dave/gnu/gcc-4.0/objdir/hppa-linux/libjava/testsuite 2>@ stdout
PASS: Class_1 byte compilation
Class_1C D I J Class_1 set_ld_library_path_env_vars: ld_library_path=.:/home/dave/gnu/gcc-4.0/objdir/hppa-linux/./libjava/.libs:/home/dave/gnu/gcc-4.0/objdir/gcc
Setting LD_LIBRARY_PATH to .:/home/dave/gnu/gcc-4.0/objdir/hppa-linux/./libjava/.libs:/home/dave/gnu/gcc-4.0/objdir/gcc:.:/home/dave/gnu/gcc-4.0/objdir/hppa-linux/./libjava/.libs:/home/dave/gnu/gcc-4.0/objdir/gcc:.:/home/dave/gnu/gcc-4.0/objdir/hppa-linux/./libjava/.libs:/home/dave/gnu/gcc-4.0/objdir/gcc
Testing class `Class_1'...
Exception in thread "main" java.lang.NoClassDefFoundError: C
   at java.lang.VMThrowable (natVMThrowable.cc:33)
   at java.lang.Throwable (Throwable.java:498)
   at java.lang.Throwable (Throwable.java:159)
   at java.lang.Error (Error.java:80)
   at java.lang.LinkageError (LinkageError.java:71)
   at java.lang.NoClassDefFoundError (NoClassDefFoundError.java:73)
   at gnu.java.lang.MainThread (natMainThread.cc:47)
FAIL: Class_1 execution - gij test
UNTESTED: Class_1 output - gij test

Committed to trunk, tested on hppa-unknown-linux-gnu.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2005-08-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	PR libgcj/21692
	* sysdep/pa/descriptor.h: New file.
	* configure.host: Use sysdep/pa/descriptor.h on hppa*-*.

Index: configure.host
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.host,v
retrieving revision 1.70
diff -u -3 -p -r1.70 configure.host
--- configure.host	14 Jun 2005 23:33:08 -0000	1.70
+++ configure.host	20 Aug 2005 19:00:03 -0000
@@ -278,10 +278,14 @@ case "${host}" in
 esac
 
 case "${host}" in
-  ia64-* | hppa*-*)
+  ia64-*)
 	descriptor_h=sysdep/descriptor-y.h
 	;;
 
+  hppa*-*)
+	descriptor_h=sysdep/pa/descriptor.h
+	;;
+
   rs6000-* | powerpc*-*)
 	descriptor_h=sysdep/powerpc/descriptor.h
 	;;
--- /dev/null	2005-06-13 18:39:15.000000000 -0400
+++ sysdep/pa/descriptor.h	2005-08-19 21:38:34.000000000 -0400
@@ -0,0 +1,7 @@
+// Given a function pointer, return the code address.
+// If the plabel bit is set, mask it off and return the code from the
+// first word of the function descriptor.  Otherwise, the function
+// pointer is the code address.
+
+#define UNWRAP_FUNCTION_DESCRIPTOR(X) \
+  (((unsigned int)(X)) & 2 ? *(void **)(((unsigned int)(X)) & ~3) : (X))



More information about the Gcc-patches mailing list