On Sat, 04 Jun 2011, Jonathan Nieder wrote:
> > Typically, the cryptic message indicates an overflow of the stub stable
> > generated by the linker.
> [... lots of helpful details snipped ...]
>
> Thanks for a nice explanation. Do you mind if I forward this
> information to the bug log at [email protected]? At the very
> least the bug report can help the next person who runs into this to
> understand what is happening a little better.
Testing the attached change to gcc. Something similar needs to be done
to binutils.
This is still a hack but stub overflow will be less likely.
Dave
--
J. David Anglin [email protected]
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c (revision 174648)
+++ config/pa/pa.c (working copy)
@@ -7439,7 +7439,7 @@
return 24;
else
{
- if (!TARGET_LONG_CALLS && distance < 240000)
+ if (!TARGET_LONG_CALLS && distance < MAX_PCREL17F_OFFSET)
return 8;
if (TARGET_LONG_ABS_CALL && !flag_pic)
@@ -7652,7 +7652,7 @@
/* pc-relative branch. */
if (!TARGET_LONG_CALLS
&& ((TARGET_PA_20 && !sibcall && distance < 7600000)
- || distance < 240000))
+ || distance < MAX_PCREL17F_OFFSET))
length += 8;
/* 64-bit plabel sequence. */
@@ -8011,7 +8011,7 @@
if (TARGET_FAST_INDIRECT_CALLS
|| (!TARGET_PORTABLE_RUNTIME
&& ((TARGET_PA_20 && !TARGET_SOM && distance < 7600000)
- || distance < 240000)))
+ || distance < MAX_PCREL17F_OFFSET)))
return 8;
if (flag_pic)
Index: config/pa/pa.h
===================================================================
--- config/pa/pa.h (revision 174648)
+++ config/pa/pa.h (working copy)
@@ -1512,3 +1512,12 @@
#undef TARGET_HAVE_TLS
#define TARGET_HAVE_TLS true
#endif
+
+/* The maximum offset in bytes for a PA 1.X pc-relative call to the
+ tail of the preceding stub table. The selected offsets have been
+ chosen to allow approximately one call stub for every 86 instructions.
+ A long branch stub is two instructions when not generating PIC code.
+ More space is allowed for stubs when generating PIC code since HP-UX
+ and Linux import stubs are seven and four instructions, respectively. */
+#define MAX_PCREL17F_OFFSET \
+ ((flag_pic ? (TARGET_HPUX ? 198164 : 221312) : 240000)