[committed] pa: Adjust MAX_PCREL17F_OFFSET to match stub group size default for ELF

Message ID 7878c87c-6ed6-b26f-b75a-edece9287179@bell.net
State New
Headers show
Series
  • [committed] pa: Adjust MAX_PCREL17F_OFFSET to match stub group size default for ELF
Related show

Commit Message

John David Anglin Oct. 3, 2019, 11:44 p.m.
There are still a few packages that fail to build on Debian linux because we end up
with branches that can't reach their target.  It turns out that the default maximum
stub group size in binutils is smaller than what we allow in gcc.  This patch reduces
the maximum offset in gcc to match that in binutils.

I also made the maximum offset for PIC and non-PIC code the same.  While PIC long
branches are three instructions versus two, the stubs for non-local calls are the
same length.

Tested on hppa-unknown-linux-gnu.  Committed to trunk.

Dave

2019-10-03  John David Anglin  <danglin@gcc.gnu.org>

	* config/pa/pa.h (MAX_PCREL17F_OFFSET): Adjust.

Patch

Index: config/pa/pa.h
===================================================================
--- config/pa/pa.h	(revision 276260)
+++ config/pa/pa.h	(working copy)
@@ -1292,13 +1292,12 @@ 
 #endif

 /* The maximum offset in bytes for a PA 1.X pc-relative call to the
-   head of the preceding stub table.  The selected offsets have been
-   chosen so that approximately one call stub is allocated for every
-   86.7 instructions.  A long branch stub is two instructions when
-   not generating PIC code.  For HP-UX and ELF targets, PIC stubs are
-   seven and four instructions, respectively.  */
-#define MAX_PCREL17F_OFFSET \
-  (flag_pic ? (TARGET_HPUX ? 198164 : 221312) : 240000)
+   head of the preceding stub table.  A long branch stub is two or three
+   instructions for non-PIC and PIC, respectively.  Import stubs are
+   seven and five instructions for HP-UX and ELF targets, respectively.
+   The default stub group size for ELF targets is 217856 bytes.
+   FIXME: We need an option to set the maximum offset.  */
+#define MAX_PCREL17F_OFFSET (TARGET_HPUX ? 198164 : 217856)

 #define NEED_INDICATE_EXEC_STACK 0