linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Andy Lutomirski <luto@mit.edu>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	luto@mit.edu, a.miskiewicz@gmail.com, tglx@linutronix.de,
	hpa@linux.intel.com, luto@mit.edu
Subject: [tip:x86/vdso] x86-64: Work around gold bug 13023
Date: Fri, 5 Aug 2011 05:38:11 GMT	[thread overview]
Message-ID: <tip-f670bb760e7d32ec9c690e748a1d5d04921363ab@git.kernel.org> (raw)
In-Reply-To: <0b260cb806f1f9a25c00ce8377a5f035d57f557a.1312378163.git.luto@mit.edu>

Commit-ID:  f670bb760e7d32ec9c690e748a1d5d04921363ab
Gitweb:     http://git.kernel.org/tip/f670bb760e7d32ec9c690e748a1d5d04921363ab
Author:     Andy Lutomirski <luto@MIT.EDU>
AuthorDate: Wed, 3 Aug 2011 09:31:51 -0400
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Thu, 4 Aug 2011 16:13:38 -0700

x86-64: Work around gold bug 13023

Gold has trouble assigning numbers to the location counter inside of
an output section description.  The bug was triggered by
9fd67b4ed0714ab718f1f9bd14c344af336a6df7, which consolidated all of
the vsyscall sections into a single section.  The workaround is IMO
still nicer than the old way of doing it.

This produces an apparently valid kernel image and passes my vdso
tests on both GNU ld version 2.21.51.0.6-2.fc15 20110118 and GNU
gold (version 2.21.51.0.6-2.fc15 20110118) 1.10 as distributed by
Fedora 15.

Signed-off-by: Andy Lutomirski <luto@mit.edu>
Link: http://lkml.kernel.org/r/0b260cb806f1f9a25c00ce8377a5f035d57f557a.1312378163.git.luto@mit.edu
Reported-by: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/kernel/vmlinux.lds.S |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index e79fb39..8f3a265 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -158,10 +158,12 @@ SECTIONS
 	__vvar_page = .;
 
 	.vvar : AT(ADDR(.vvar) - LOAD_OFFSET) {
+		/* work around gold bug 13023 */
+		__vvar_beginning_hack = .;
 
-	      /* Place all vvars at the offsets in asm/vvar.h. */
-#define EMIT_VVAR(name, offset) 		\
-		. = offset;		\
+		/* Place all vvars at the offsets in asm/vvar.h. */
+#define EMIT_VVAR(name, offset) 			\
+		. = __vvar_beginning_hack + offset;	\
 		*(.vvar_ ## name)
 #define __VVAR_KERNEL_LDS
 #include <asm/vvar.h>
@@ -184,15 +186,17 @@ SECTIONS
 
 	. = VSYSCALL_ADDR;
 	.vsyscall : AT(VLOAD(.vsyscall)) {
+		/* work around gold bug 13023 */
+		__vsyscall_beginning_hack = .;
 		*(.vsyscall_0)
 
-		. = 1024;
+		. = __vsyscall_beginning_hack + 1024;
 		*(.vsyscall_1)
 
-		. = 2048;
+		. = __vsyscall_beginning_hack + 2048;
 		*(.vsyscall_2)
 
-		. = 4096;  /* Pad the whole page. */
+		. = __vsyscall_beginning_hack + 4096;  /* Pad the whole page. */
 	} :user =0xcc
 	. = ALIGN(__vsyscall_0 + PAGE_SIZE, PAGE_SIZE);
 

  reply	other threads:[~2011-08-05  5:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03 13:31 [PATCH v2 0/6] Collected vdso/vsyscall fixes for 3.1 Andy Lutomirski
2011-08-03 13:31 ` [PATCH v2 1/6] x86-64: Pad vDSO to a page boundary Andy Lutomirski
2011-08-05  5:37   ` [tip:x86/vdso] " tip-bot for Andy Lutomirski
2011-08-03 13:31 ` [PATCH v2 2/6] x86-64: Move the "user" vsyscall segment out of the data segment Andy Lutomirski
2011-08-05  5:37   ` [tip:x86/vdso] " tip-bot for Andy Lutomirski
2011-08-03 13:31 ` [PATCH v2 3/6] x86-64: Work around gold bug 13023 Andy Lutomirski
2011-08-05  5:38   ` tip-bot for Andy Lutomirski [this message]
2011-08-03 13:31 ` [PATCH v2 4/6] x86-64/xen: Enable the vvar mapping Andy Lutomirski
2011-08-03 13:49   ` Konrad Rzeszutek Wilk
2011-08-05  5:38   ` [tip:x86/vdso] x86-64, xen: " tip-bot for Andy Lutomirski
2011-08-03 13:31 ` [PATCH v2 5/6] x86-64: Add user_64bit_mode paravirt op Andy Lutomirski
2011-08-05  5:39   ` [tip:x86/vdso] " tip-bot for Andy Lutomirski
2011-08-03 13:31 ` [PATCH v2 6/6] x86-64: Add vsyscall:emulate_vsyscall trace event Andy Lutomirski
2011-08-05  5:39   ` [tip:x86/vdso] " tip-bot for Andy Lutomirski
2011-08-03 13:53 ` [PATCH v2 0/6] Collected vdso/vsyscall fixes for 3.1 Konrad Rzeszutek Wilk
2011-08-03 13:56   ` Konrad Rzeszutek Wilk
2011-08-03 13:59     ` Andrew Lutomirski
2011-08-11 20:28       ` Jeremy Fitzhardinge
2011-08-11 20:47         ` Andrew Lutomirski
2011-08-03 17:34 ` [Xen-devel] " Sander Eikelenboom

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=tip-f670bb760e7d32ec9c690e748a1d5d04921363ab@git.kernel.org \
    --to=luto@mit.edu \
    --cc=a.miskiewicz@gmail.com \
    --cc=hpa@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.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;
as well as URLs for NNTP newsgroup(s).