public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jeroen Hofstee <jeroen@myspectrum.nl>
To: u-boot@lists.denx.de
Subject: [U-Boot] arm: U-Boot API - clang support broke ABI
Date: Sat, 23 Nov 2013 12:20:54 +0100	[thread overview]
Message-ID: <52908F96.9080009@myspectrum.nl> (raw)
In-Reply-To: <20131118112659.GB1567@rocoto.smurfnet.nu>

Hello Leif,

On 11/18/2013 12:26 PM, Leif Lindholm wrote:
> Commit fe1378a - "ARM: use r9 for gd" - broke the ABI for users of the
> U-Boot API on ARM. Users I am aware of are GRUB and the FreeBSD loader.
> Since I only spotted this on Saturday, this code is well and truly in
> the wild, so any users of the API will need to preserve both r8 and r9
> on syscalls for the foreseeable future (which is not the end of the
> world).

After looking into it a bit better it seems the standalone applications
don't use the api, but poke into u-boot directly to look for a
separate jump-table in gd. I am still a bit surprised it works like that,
but at least the api doesn't. (I sent a patch to fix them)

The api issue is therefore only related to requirement that r9 needs
to be preserved. The README states since the beginning of the git
repro (2002-11-03) [1] that r8 _and_ r9 have special meaning in U-boot.
Albert removed the need for the GOT pointer (r9) over time by limiting
the supported relocation types, so the move from r8 to r9 was not
expected to cause an ABI problem, since both were special register
already. Anyway, I will have a look if it did break the ubldr.

> Sometime last year I proposed a change to make the API syscall entry
> and exit points responsible for maintaining full procedure-call standard
> compliance, although the patch I provided was on the hackier side of
> good (and probably wrong).

After the switch to r9 the call on ARM is eabi compliant, with r9 being a
platform register as allowed by the specs. Whether u-boot or the payload
is responsible for preserving r9 / in general should preserve and restore
its special registers in API calls is better answered by the maintainers.

Regards,
Jeroen

  parent reply	other threads:[~2013-11-23 11:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18 11:26 [U-Boot] arm: U-Boot API - clang support broke ABI Leif Lindholm
2013-11-19  9:09 ` Michal Simek
2013-11-19 20:07   ` Tom Rini
2013-11-20  7:59     ` [U-Boot] standalone u-boot app - bootm issue was the part of: (Re: arm: U-Boot API - clang support broke ABI) Michal Simek
2013-11-20 13:49       ` Tom Rini
2013-11-20 13:53         ` Michal Simek
2013-11-20 14:01           ` Tom Rini
2013-11-21 15:54             ` Michal Simek
2013-11-19 22:42 ` [U-Boot] arm: U-Boot API - clang support broke ABI Jeroen Hofstee
2013-11-23 11:20 ` Jeroen Hofstee [this message]
2013-11-25 10:43   ` Leif Lindholm

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=52908F96.9080009@myspectrum.nl \
    --to=jeroen@myspectrum.nl \
    --cc=u-boot@lists.denx.de \
    /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