Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Richard Sandiford <rsandifo@redhat.com>
To: Stanislaw Skowronek <sskowron@ET.PUT.Poznan.PL>
Cc: linux-mips@linux-mips.org
Subject: Re: Unmatched R_MIPS_HI16/R_MIPS_LO16 on gcc 3.5
Date: Mon, 23 May 2005 12:17:44 +0100	[thread overview]
Message-ID: <87oeb26vjb.fsf@firetop.home> (raw)
In-Reply-To: <Pine.GSO.4.10.10505230905300.4132-100000@helios.et.put.poznan.pl> (Stanislaw Skowronek's message of "Mon, 23 May 2005 09:10:25 +0200 (MET DST)")

Stanislaw Skowronek <sskowron@ET.PUT.Poznan.PL> writes:
> It seems that gcc (with -O; -O0 fixes the issue) will generate R_MIPS_HI16
> without succeeding R_MIPS_LO16 (or the other way - but it's not a real
> problem that way) in '.rel.text' (not '.rela.text'). According to SGI ELF
> spec this combination is invalid (well, addend AHL is created from low 16
> bits from HI16 and low 16 bits from LO16, and the actual result of
> relocation might depend on the LO16 part - at least this is what I
> understood from the specific[a]tion); it also upsets Indy PROM when
> converted into ECOFF.
>
> Gcc 3.4.3 does not exhibit this (wanton) behavior. What the heck?

Remember that support for %hi() and %lo() on REL targets is a GNU extension.
The assembler is expected to reorder the relocations so that the HI16s
come before the LO16s.  It sounds like this isn't happening in your case,
so which version of binutils are you using?

This isn't really a change from gcc 3.4 to "gcc 3.5" (now known as 4.0 ;).
It has long been possible for gcc's assembly code to contain "out of order"
%hi()s and %lo()s.  On the other hand, the more aggressive the optimisers
are, the more likely you are to see it, so the behaviour will certainly
be different in specific testcases.

Richard

  reply	other threads:[~2005-05-23 11:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-23  7:10 Unmatched R_MIPS_HI16/R_MIPS_LO16 on gcc 3.5 Stanislaw Skowronek
2005-05-23 11:17 ` Richard Sandiford [this message]
2005-05-23 16:19   ` Stanislaw Skowronek
2005-05-23 17:23     ` Richard Sandiford
2005-05-23 17:32       ` Stanislaw Skowronek
2005-05-24  6:35         ` Richard Sandiford
2005-05-24  6:39           ` Stanislaw Skowronek
2005-05-24  6:56             ` Richard Sandiford
2005-05-24  6:58               ` Stanislaw Skowronek
2005-05-24 10:40                 ` Maciej W. Rozycki
2005-05-24 10:47                   ` Stanislaw Skowronek
2005-05-24 11:40                     ` Maciej W. Rozycki
2005-05-24 10:50                   ` Richard Sandiford
2005-05-24 14:22                   ` Ralf Baechle
2005-05-24 14:50                     ` Maciej W. Rozycki
2005-05-24 15:00                       ` Ralf Baechle
2005-05-24 15:04                         ` Maciej W. Rozycki

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=87oeb26vjb.fsf@firetop.home \
    --to=rsandifo@redhat.com \
    --cc=linux-mips@linux-mips.org \
    --cc=sskowron@ET.PUT.Poznan.PL \
    /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