fptr.c (__canonicalize_funcptr_for_compare): Don't canonicalize function pointers...
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>
Mon, 9 Dec 2002 19:16:14 +0000 (19:16 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Mon, 9 Dec 2002 19:16:14 +0000 (19:16 +0000)
* pa/fptr.c (__canonicalize_funcptr_for_compare): Don't canonicalize
function pointers in page 0.

From-SVN: r59964

gcc/ChangeLog
gcc/config/pa/fptr.c

index cef27a9144b08f84aeae03574c9d3ecd84dc349f..c8d682fb9354d209a40b2908d961b592dc00164b 100644 (file)
@@ -1,3 +1,8 @@
+2002-12-09  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * pa/fptr.c (__canonicalize_funcptr_for_compare): Don't canonicalize
+       function pointers in page 0.
+
 2002-12-09  Steve Ellcey  <sje@cup.hp.com>
 
        * config/ia64/hpux.h (TARGET_STRUCT_ARG_REG_LITTLE_ENDIAN): Remove
index e0bd88a28420ba07690464f0cb2774bccf39cd36..36ed49c3084e36d2e9e6a5104305e98c081df5e4 100644 (file)
@@ -64,11 +64,11 @@ __canonicalize_funcptr_for_compare (fptr)
   static fixup_t fixup;
   unsigned int *plabel, *got;
 
-  /* -1 is special.  It is used in crtend to mark the end of a list of
-     function pointers.  Also return immediately if the plabel bit is
-     not set in the function pointer.  In this case, the function pointer
-     points directly to the function.  */
-  if ((int) fptr == -1 || !((int) fptr & 2))
+  /* -1 and page 0 are special.  -1 is used in crtend to mark the end of
+     a list of function pointers.  Also return immediately if the plabel
+     bit is not set in the function pointer.  In this case, the function
+     pointer points directly to the function.  */
+  if ((int) fptr == -1 || (unsigned int) fptr < 4096 || !((int) fptr & 2))
     return (unsigned int) fptr;
 
   /* The function pointer points to a function descriptor (plabel).  If