[committed] When possible, use short pc-relative branch to thunk function on PA

John David Anglin dave@hiauly1.hia.nrc.ca
Mon Jan 12 17:39:00 GMT 2009


This fixes another regression arising from my attempt to add support to
use long branches from thunks.  We were always using long branches on
targets with named sections even when it was possible to use a short
pc-relative branch.

Tested on hppa-unknown-linux-gnu and hppa64-hp-hpux11.11.  Committed to
trunk.

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

2009-01-12  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* pa.c (pa_asm_output_mi_thunk): Use pc-relative branch to thunk
	function when not using named sections on targets with named sections
	if branch distance is less than 262132.

Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c	(revision 143207)
+++ config/pa/pa.c	(working copy)
@@ -7980,6 +7980,10 @@
 		   || ((DECL_SECTION_NAME (thunk_fndecl)
 			== DECL_SECTION_NAME (function))
 		       && last_address < 262132)))
+	      || (targetm.have_named_sections
+		  && DECL_SECTION_NAME (thunk_fndecl) == NULL
+		  && DECL_SECTION_NAME (function) == NULL
+		  && last_address < 262132)
 	      || (!targetm.have_named_sections && last_address < 262132))))
     {
       if (!val_14)



More information about the Gcc-patches mailing list