All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Owens <kaos@ocs.com.au>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] [patch] Assign __gp to middle of short data sections
Date: Thu, 01 Aug 2002 03:17:25 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590701905870@msgid-missing> (raw)

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

This patch (against 2.4.18) puts __gp right in the middle of the short
data sections.  The comment 'gp must be 16-byte aligned for exc. table'
puzzles me, AFAICT the exception tables are not accessed via gp.

Index: 19-pre10.10/arch/ia64/vmlinux.lds.S
--- 19-pre10.10/arch/ia64/vmlinux.lds.S Thu, 09 May 2002 12:00:25 +1000 kaos (linux-2.4/p/c/50_vmlinux.ld 1.1.5.1.2.1.1.1.1.2 644)
+++ 19-pre10.10(w)/arch/ia64/vmlinux.lds.S Thu, 01 Aug 2002 13:09:02 +1000 kaos (linux-2.4/p/c/50_vmlinux.ld 1.1.5.1.2.1.1.1.1.2 644)
@@ -40,8 +40,6 @@ SECTIONS
 
   /* Read-only data */
 
-  __gp = ALIGN(16) + 0x200000;	/* gp must be 16-byte aligned for exc. table */
-
   /* Global data */
   _data = .;
 
@@ -130,6 +128,7 @@ SECTIONS
   .data : AT(ADDR(.data) - PAGE_OFFSET)
 	{ *(.data) *(.gnu.linkonce.d*) CONSTRUCTORS }
 
+  __got = ALIGN(16);
   .got : AT(ADDR(.got) - PAGE_OFFSET)
 	{ *(.got.plt) *(.got) }
   /* We want the small data sections together, so single-instruction offsets
@@ -141,6 +140,7 @@ SECTIONS
   _bss = .;
   .sbss : AT(ADDR(.sbss) - PAGE_OFFSET)
 	{ *(.sbss) *(.scommon) }
+  __gp = (. - (. - __got) / 2) & -16;	/* put __gp in the middle of the short data areas */
   .bss : AT(ADDR(.bss) - PAGE_OFFSET)
 	{ *(.bss) *(COMMON) }
   . = ALIGN(64 / 8);



             reply	other threads:[~2002-08-01  3:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-01  3:17 Keith Owens [this message]
2002-08-01  4:01 ` [Linux-ia64] [patch] Assign __gp to middle of short data sect Luck, Tony
2002-08-01  4:10 ` [Linux-ia64] [patch] Assign __gp to middle of short data sections David Mosberger
2002-08-01  6:00 ` 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-105590701905870@msgid-missing \
    --to=kaos@ocs.com.au \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.