Linux PARISC architecture development
 help / color / mirror / Atom feed
From: John David Anglin <dave.anglin@bell.net>
To: Carlos O'Donell <carlos@systemhalted.org>
Cc: Rolf Eike Beer <eike@sf-mail.de>,
	linux-parisc <linux-parisc@vger.kernel.org>
Subject: Re: Link error in CMake for HPPA1.1, wrong result for HPPA 2.0
Date: Thu, 25 Aug 2011 11:46:53 -0400	[thread overview]
Message-ID: <4E566E6D.8060100@bell.net> (raw)
In-Reply-To: <4E5656E4.8000102@systemhalted.org>

[-- Attachment #1: Type: text/plain, Size: 1177 bytes --]

On 8/25/2011 10:06 AM, Carlos O'Donell wrote:
> On 8/25/2011 6:37 AM, Rolf Eike Beer wrote:
>> const&)]+0xbc): cannot reach
>> 00004abb__ZNSt8_Rb_treeIN5cmsys6StringESt4pairIKS1_iESt10_Select1stIS4_ESt4lessIS1_ESaIS4_EE8_S_rightEPSt18_Rb_tree_node_base+0,
>> recompile with -ffunction-sections
> So did you recompile with -ffunction-sections?
>
> The basic problem is that the linker was unable to insert a jump
> to the requested function because it was too far away. Some targets
> like hppa have short branch distances and we use intermediate stub
> tables to get around that. However, we can't insert stub tables just
> anywhere, they need to go between sections. Therefore you need to
> break up this object file.
I think there is a real bug here but nobody has provided a test case.  
-ffunction-sections
probably won't help.

Stub sizes vary depending on whether PIC code or non PIC code is being 
generated.
We need a bigger stub table for PIC C++ code as C++ tends to generate a 
lot of small
routines.

I've attached the GCC part of the change.  There's also a binutils patch 
which I can't
access at the moment.

Dave

-- 
John David Anglin    dave.anglin@bell.net


[-- Attachment #2: pcrel.d --]
[-- Type: text/plain, Size: 1689 bytes --]

Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c	(revision 178012)
+++ config/pa/pa.c	(working copy)
@@ -7385,7 +7385,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)
@@ -7598,7 +7598,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.  */
@@ -7957,7 +7957,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 178012)
+++ 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)

  parent reply	other threads:[~2011-08-25 15:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 10:37 Link error in CMake for HPPA1.1, wrong result for HPPA 2.0 Rolf Eike Beer
2011-08-25 14:06 ` Carlos O'Donell
2011-08-25 15:21   ` Rolf Eike Beer
2011-08-25 15:46   ` John David Anglin [this message]
2011-08-29  8:12     ` Rolf Eike Beer
2011-08-29  9:47       ` Rolf Eike Beer
2011-08-29 14:38       ` John David Anglin
2011-08-29 18:31         ` Rolf Eike Beer
2011-09-07 23:35           ` John David Anglin
2011-09-08 15:22             ` Carlos O'Donell
2011-08-26  8:00   ` Rolf Eike Beer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E566E6D.8060100@bell.net \
    --to=dave.anglin@bell.net \
    --cc=carlos@systemhalted.org \
    --cc=eike@sf-mail.de \
    --cc=linux-parisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox