public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: Fix for s390_elf_cons.
@ 2001-07-30 11:43 Martin Schwidefsky
  2001-07-30 18:19 ` Alan Modra
  0 siblings, 1 reply; 10+ messages in thread
From: Martin Schwidefsky @ 2001-07-30 11:43 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

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

>This leaves me wondering why your plt relocs are marked pcrel.  It seems
>to me that they ought to be non-pcrel since you are already subtracting
>off a location-relative value with "-.LT0_0".  Alternatively, the correct
>syntax for a pc-relative relocation would be
>
>    .long     printk@PLT + (. - .LT0_0)
>
>since a pc-relative reloc implicitly subtracts "." from the symbol value.

Hmm, but .LT0_0 is a local label for the start of the literal pool. What
you have is

     .long (printk@PLT - .) + (. - .LT0_0)

The second part is an absolute addend and the first part is the pc relative
distance to the plt of printk. Does this makes sense?

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


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: Fix for s390_elf_cons.
@ 2001-08-13  0:59 Martin Schwidefsky
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Schwidefsky @ 2001-08-13  0:59 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: binutils, Ulrich Weigand

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

>In that case: Martin, shall I commit the patch?
Yes, please do so.

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


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: Fix for s390_elf_cons.
@ 2001-07-31  0:59 Martin Schwidefsky
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Schwidefsky @ 2001-07-31  0:59 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

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

>Somewhat :)  I'm claiming that the subtraction of the current location is
>implicit since you are using a pc-relative relocation.
>
>Consider an analogy with pcrel call insns on many architectures.  We
>write "call foo", which generates a pcrel reloc against foo with an
>implicit subtraction of ".".  We don't write "call foo - .".  On x86,
>which uses a pcrel plt reloc, we have "call foo@PLT" too, not
>"call foo@PLT - ."  This extends to ".long foo@PLT" if you want a
>pcrel plt reloc.

Yes in the case of a call instruction it makes sense. We make use of
the same notation for the brasl instruction in the 64 bit assembler.
It makes sense because the instructions gives you the hint that you
are dealing with an implicit "- .". In the case of .long you don't
have that hint. And a ".long printk@PLT + . - .LT0_0" is somewhat
harder to understand than ".long printk@PLT - .LT0_0". The pseudo
op .long is by itself absolute.

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


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Fix for s390_elf_cons.
@ 2001-07-29 14:58 Martin Schwidefsky
  2001-07-29 16:55 ` H . J . Lu
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Martin Schwidefsky @ 2001-07-29 14:58 UTC (permalink / raw)
  To: binutils

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

Hi,
Andreas complained that binutils-2.11.90.0.24 doesn't work on s390/s390x.
Well he is right. The problem is that the behaviour of fixup_segment has
changed a bit.  The solution is to pass false for pcrel on the call to
fix_new_exp in s390_elf_cons. Then the missing pc relative conversion in
fixup_segment are done again.

blue skies,
   Martin

2001-07-29  Martin Schwidefsky  <schwidefsky@de.ibm.com>

     * config/tc-s390.c (s390_elf_cons): Correct fixups for PLT
     relocations.

(See attached file: elf_cons.diff)

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: elf_cons.diff --]
[-- Type: text/x-diff, Size: 720 bytes --]

diff -urN src/gas/config/tc-s390.c src-s390/gas/config/tc-s390.c
--- src/gas/config/tc-s390.c	Thu Jul 26 21:07:01 2001
+++ src-s390/gas/config/tc-s390.c	Sun Jul 29 23:40:08 2001
@@ -943,8 +943,10 @@
 			reloc_howto->name, nbytes);
 	      where = frag_more (nbytes);
 	      md_number_to_chars (where, 0, size);
-	      fix_new_exp (frag_now, where - frag_now->fr_literal, 
-			   size, &exp, reloc_howto->pc_relative, reloc);
+	      /* To make fixup_segment do the pc relative conversion the
+		 pcrel parameter on the fix_new_exp call needs to be false.  */
+	      fix_new_exp (frag_now, where - frag_now->fr_literal,
+			   size, &exp, false, reloc);
 	    }
 	  else
 	    as_bad (_("relocation not applicable"));

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-08-13  0:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-30 11:43 Fix for s390_elf_cons Martin Schwidefsky
2001-07-30 18:19 ` Alan Modra
  -- strict thread matches above, loose matches on Subject: below --
2001-08-13  0:59 Martin Schwidefsky
2001-07-31  0:59 Martin Schwidefsky
2001-07-29 14:58 Martin Schwidefsky
2001-07-29 16:55 ` H . J . Lu
2001-07-29 21:17 ` Alan Modra
2001-08-07  4:41 ` Andreas Jaeger
2001-08-07  5:59   ` Alan Modra
2001-08-07  6:04     ` Andreas Jaeger

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).