public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Martin Schwidefsky" <schwidefsky@de.ibm.com>
To: Alan Modra <amodra@bigpond.net.au>
Cc: Nick Clifton <nickc@cambridge.redhat.com>,
	Jakub Jelinek <jakub@redhat.com>,
	binutils@sources.redhat.com, laroche@redhat.com
Subject: Re: s390 gas bug
Date: Thu, 04 Oct 2001 04:35:00 -0000	[thread overview]
Message-ID: <OF446545D6.7001EF6D-ONC1256ADB.003DAB9C@de.ibm.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 936 bytes --]

>Well, no, not for this particular case.  You need to define
>TC_FORCE_RELOCATION to cover this situation because to the generic
>code in write.c:fixup_segment, your "f1@PLT-.LT1_0" expression
>looks like the subtraction of two syms in one segment.  The normal
>action is to perform the subtraction and not emit a reloc.

Ok, here is a patch that force all GOT and PLT relocations:

ChangeLog for gas:

2001-10-04  Martin Schwidefsky <schwidefsky@de.ibm.com>

     * gas/config/tc-s390.h (TC_FORCE_RELOCATION): Relace by a call to
     tc_s390_force_relocation.
     * gas/config/tc-s390.c (s390_force_relocation): Add function
     tc_s390_force_relocation that forces all GOT and PLT relocations.

(See attached file: force-reloc.diff)

blue skies,
   Martin

Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH
Schönaicherstr. 220, D-71032 Böblingen, Telefon: 49 - (0)7031 - 16-2247
E-Mail: schwidefsky@de.ibm.com

[-- Attachment #2: force-reloc.diff --]
[-- Type: text/x-diff, Size: 1876 bytes --]

diff -urN src/gas/config/tc-s390.c src-s390/gas/config/tc-s390.c
--- src/gas/config/tc-s390.c	Thu Sep 20 13:08:00 2001
+++ src-s390/gas/config/tc-s390.c	Thu Oct  4 12:54:52 2001
@@ -1641,6 +1641,35 @@
   return 1;
 }
 
+/* Return true if we must always emit a reloc for a type and false if
+   there is some hope of resolving it a assembly time.  */
+int
+tc_s390_force_relocation (fixp)
+     struct fix *fixp;
+{
+  switch (fixp->fx_r_type)
+    {
+    case BFD_RELOC_390_GOT12:
+    case BFD_RELOC_32_GOT_PCREL:
+    case BFD_RELOC_32_GOTOFF:
+    case BFD_RELOC_390_GOTPC:
+    case BFD_RELOC_390_GOT16:
+    case BFD_RELOC_390_GOTPCDBL:
+    case BFD_RELOC_390_GOT64:
+    case BFD_RELOC_390_GOTENT:
+    case BFD_RELOC_390_PLT32:
+    case BFD_RELOC_390_PLT16DBL:
+    case BFD_RELOC_390_PLT32DBL:
+    case BFD_RELOC_390_PLT64:
+    case BFD_RELOC_VTABLE_INHERIT:
+    case BFD_RELOC_VTABLE_ENTRY:
+      return 1;
+      
+    default:
+      return 0;
+    }
+}
+
 /* Apply a fixup to the object code.  This is called for all the
    fixups we generated by the call to fix_new_exp, above.  In the call
    above we used a reloc code which was the largest legal reloc code
diff -urN src/gas/config/tc-s390.h src-s390/gas/config/tc-s390.h
--- src/gas/config/tc-s390.h	Thu Jul 26 21:07:01 2001
+++ src-s390/gas/config/tc-s390.h	Thu Oct  4 12:30:47 2001
@@ -44,9 +44,8 @@
            && S_IS_DEFINED ((FIX)->fx_addsy)      \
            && ! S_IS_COMMON ((FIX)->fx_addsy))))
 
-#define TC_FORCE_RELOCATION(FIXP)       \
-  ((FIXP)->fx_r_type == BFD_RELOC_VTABLE_INHERIT	\
-   || (FIXP)->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
+#define TC_FORCE_RELOCATION(FIXP) tc_s390_force_relocation(FIXP)
+extern int tc_s390_force_relocation PARAMS ((struct fix *));
 
 #define tc_fix_adjustable(X)  tc_s390_fix_adjustable(X)
 extern int tc_s390_fix_adjustable PARAMS ((struct fix *));

             reply	other threads:[~2001-10-04  4:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-04  4:35 Martin Schwidefsky [this message]
2001-10-04  6:04 ` Alan Modra
2001-10-14  2:48   ` Andreas Jaeger
  -- strict thread matches above, loose matches on Subject: below --
2002-10-18  1:02 Martin Schwidefsky
2001-10-31 10:57 Martin Schwidefsky
2001-10-04  6:21 Martin Schwidefsky
2001-10-02  6:58 Martin Schwidefsky
2001-10-02  7:34 ` Alan Modra
2001-10-02  5:15 Jakub Jelinek
2001-10-02  6:38 ` Nick Clifton

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=OF446545D6.7001EF6D-ONC1256ADB.003DAB9C@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=amodra@bigpond.net.au \
    --cc=binutils@sources.redhat.com \
    --cc=jakub@redhat.com \
    --cc=laroche@redhat.com \
    --cc=nickc@cambridge.redhat.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).