public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] [patch] Assign __gp to middle of short data sections
Date: Thu, 01 Aug 2002 04:10:40 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590701905872@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590701905870@msgid-missing>

>>>>> On Thu, 01 Aug 2002 13:17:25 +1000, Keith Owens <kaos@ocs.com.au> said:

  Keith> I was getting '__gp does not cover short data segment'.
  Keith> arch/ia64/vmlinus.lds.S assigns __gp well away from the short
  Keith> data sections, for no good reason that I can see.  A kernel
  Keith> with more than 2^21 bytes between __gp and the end of sbss
  Keith> cannot link.

  Keith> This patch (against 2.4.18) puts __gp right in the middle of
  Keith> the short data sections.

Umh, the got must be covered by the __gp too!

The real problem that you were seeing is that the (old) linker script
aligned __gp, but not the section it was pointing to.  If the previous
section ended on an address that was not 16-byte aligned, this would
have the effect of putting the first word in the got out of reach.  I
fixed this bug a while ago (about two 2.4.18 patches ago, IIRC).  The
corrected version reads like this:

  . = ALIGN(16);
  __gp = . + 0x200000;	/* gp must be 16-byte aligned for exc. table */

  Keith> The comment 'gp must be 16-byte
  Keith> aligned for exc. table' puzzles me, AFAICT the exception
  Keith> tables are not accessed via gp.

The addresses in the exception table are currently gp-relative (so
they fit in 32 bits), with the least-significant four bits reserved to
encode extra info (such as slot number).  If someone cares, this table
probably could be converted to use IP-relative addresses, in which
case this constraint could be dropped.

	--david


  parent reply	other threads:[~2002-08-01  4:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-01  3:17 [Linux-ia64] [patch] Assign __gp to middle of short data sections Keith Owens
2002-08-01  4:01 ` [Linux-ia64] [patch] Assign __gp to middle of short data sect Luck, Tony
2002-08-01  4:10 ` David Mosberger [this message]
2002-08-01  6:00 ` [Linux-ia64] [patch] Assign __gp to middle of short data sections Keith Owens
2002-08-01  6:26 ` David Mosberger

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=marc-linux-ia64-105590701905872@msgid-missing \
    --to=davidm@napali.hpl.hp.com \
    --cc=linux-ia64@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