diff mbox

[committed] Build valid PA-RISC function pointer for fixup in __canonicalize_funcptr_for_compare

Message ID 47419869-B530-4B2B-8CB5-B0EE508897E8@bell.net
State New
Headers show

Commit Message

John David Anglin June 18, 2016, 6 p.m. UTC
The attached change is preparation for a patch to optimize indirect calls.  For this, we need to a
valid function pointer for fixup in __canonicalize_funcptr_for_compare.  The least-significant two
bits of the pointer should have the value 2, not 3, when the pointer points to a function descriptor.

Tested on hppa-unknown-linux-gnu and committed to trunk.

Dave
--
John David Anglin	dave.anglin@bell.net
2016-06-18  John David Anglin  <danglin@gcc.gnu.org>

	* config/pa/fptr.c (__canonicalize_funcptr_for_compare): Don't set
	least-significant bit in function pointer for fixup.
diff mbox

Patch

Index: config/pa/fptr.c
===================================================================
--- config/pa/fptr.c	(revision 237565)
+++ config/pa/fptr.c	(working copy)
@@ -113,7 +113,7 @@ 
   /* Build a plabel for an indirect call to _dl_fixup.  */
   fixup_plabel[0] = (unsigned int) iptr + 8;	/* address of fixup */
   fixup_plabel[1] = got[-1];			/* ltp for fixup */
-  fixup = (fixup_t) ((int) fixup_plabel | 3);
+  fixup = (fixup_t) ((int) fixup_plabel | 2);
 
   /* Call fixup to resolve the function address.  got[1] contains the
      link_map pointer and plabel[1] the relocation offset.  */