* [PATCH] x86, vdso: Fix vdso-layout linker script
@ 2014-04-03 17:43 Markus Trippelsdorf
2014-04-03 17:47 ` Andy Lutomirski
2014-04-03 17:53 ` [PATCH] x86, vdso: Make the vdso linker script compatible with Gold Andy Lutomirski
0 siblings, 2 replies; 4+ messages in thread
From: Markus Trippelsdorf @ 2014-04-03 17:43 UTC (permalink / raw)
To: linux-nfs; +Cc: Andy Lutomirski, H. Peter Anvin
Commit 26f5ef2e3c3 added a /DISCARD/ section to the vdso-layout.lds.S
linker script. This broke the build when using the gold linker:
ld: error: arch/x86/vdso/vdso.lds:79:12: syntax error, unexpected ':'
ld: fatal error: unable to parse script file arch/x86/vdso/vdso.lds
As Cary Coutant pointed out on the sourceware bugzilla:
https://sourceware.org/bugzilla/show_bug.cgi?id=16804
the problem is that the .text section directly above the /DISCARD/
section should be terminated with an comma.
Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
diff --git a/arch/x86/vdso/vdso-layout.lds.S b/arch/x86/vdso/vdso-layout.lds.S
index 2e263f367b13..313bca59ddea 100644
--- a/arch/x86/vdso/vdso-layout.lds.S
+++ b/arch/x86/vdso/vdso-layout.lds.S
@@ -61,7 +61,7 @@ SECTIONS
*/
. = ALIGN(0x100);
- .text : { *(.text*) } :text =0x90909090
+ .text : { *(.text*) } :text =0x90909090,
/DISCARD/ : {
*(.discard)
--
Markus
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] x86, vdso: Fix vdso-layout linker script
2014-04-03 17:43 [PATCH] x86, vdso: Fix vdso-layout linker script Markus Trippelsdorf
@ 2014-04-03 17:47 ` Andy Lutomirski
2014-04-03 17:53 ` [PATCH] x86, vdso: Make the vdso linker script compatible with Gold Andy Lutomirski
1 sibling, 0 replies; 4+ messages in thread
From: Andy Lutomirski @ 2014-04-03 17:47 UTC (permalink / raw)
To: Markus Trippelsdorf; +Cc: linux-nfs, H. Peter Anvin
On Thu, Apr 3, 2014 at 10:43 AM, Markus Trippelsdorf
<markus@trippelsdorf.de> wrote:
> Commit 26f5ef2e3c3 added a /DISCARD/ section to the vdso-layout.lds.S
> linker script. This broke the build when using the gold linker:
>
> ld: error: arch/x86/vdso/vdso.lds:79:12: syntax error, unexpected ':'
> ld: fatal error: unable to parse script file arch/x86/vdso/vdso.lds
>
> As Cary Coutant pointed out on the sourceware bugzilla:
> https://sourceware.org/bugzilla/show_bug.cgi?id=16804
> the problem is that the .text section directly above the /DISCARD/
> section should be terminated with an comma.
>
> Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
This patch triggers an internal error in whatever version of gold I'm
using. I'll send a variant of the patch when I finish testing it.
>
> diff --git a/arch/x86/vdso/vdso-layout.lds.S b/arch/x86/vdso/vdso-layout.lds.S
> index 2e263f367b13..313bca59ddea 100644
> --- a/arch/x86/vdso/vdso-layout.lds.S
> +++ b/arch/x86/vdso/vdso-layout.lds.S
> @@ -61,7 +61,7 @@ SECTIONS
> */
> . = ALIGN(0x100);
>
> - .text : { *(.text*) } :text =0x90909090
> + .text : { *(.text*) } :text =0x90909090,
>
> /DISCARD/ : {
> *(.discard)
> --
> Markus
--
Andy Lutomirski
AMA Capital Management, LLC
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] x86, vdso: Make the vdso linker script compatible with Gold
2014-04-03 17:43 [PATCH] x86, vdso: Fix vdso-layout linker script Markus Trippelsdorf
2014-04-03 17:47 ` Andy Lutomirski
@ 2014-04-03 17:53 ` Andy Lutomirski
2014-04-03 19:16 ` [tip:x86/vdso] " tip-bot for Andy Lutomirski
1 sibling, 1 reply; 4+ messages in thread
From: Andy Lutomirski @ 2014-04-03 17:53 UTC (permalink / raw)
To: H. Peter Anvin, Markus Trippelsdorf
Cc: linux-kernel, linux-nfs, Andy Lutomirski
Gold can't parse the script due to:
https://sourceware.org/bugzilla/show_bug.cgi?id=16804
With a workaround in place for that issue, Gold 2.23 crashes due to:
https://sourceware.org/bugzilla/show_bug.cgi?id=15355
This works around the former bug and avoids the second by removing
the unnecessary vvar and hpet sections and segments. The vdso and
hpet symbols are still there, and nothing needed the sections or
segments.
Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
---
arch/x86/vdso/vdso-layout.lds.S | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/arch/x86/vdso/vdso-layout.lds.S b/arch/x86/vdso/vdso-layout.lds.S
index 2e263f3..9df017a 100644
--- a/arch/x86/vdso/vdso-layout.lds.S
+++ b/arch/x86/vdso/vdso-layout.lds.S
@@ -9,12 +9,9 @@ SECTIONS
#ifdef BUILD_VDSO32
#include <asm/vdso32.h>
- .hpet_sect : {
- hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE);
- } :text :hpet_sect
+ hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE);
- .vvar_sect : {
- vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE);
+ vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE);
/* Place all vvars at the offsets in asm/vvar.h. */
#define EMIT_VVAR(name, offset) vvar_ ## name = vvar + offset;
@@ -22,7 +19,6 @@ SECTIONS
#include <asm/vvar.h>
#undef __VVAR_KERNEL_LDS
#undef EMIT_VVAR
- } :text :vvar_sect
#endif
. = SIZEOF_HEADERS;
@@ -61,7 +57,12 @@ SECTIONS
*/
. = ALIGN(0x100);
- .text : { *(.text*) } :text =0x90909090
+ .text : { *(.text*) } :text =0x90909090,
+
+ /*
+ * The comma above works around a bug in gold:
+ * https://sourceware.org/bugzilla/show_bug.cgi?id=16804
+ */
/DISCARD/ : {
*(.discard)
@@ -84,8 +85,4 @@ PHDRS
dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
note PT_NOTE FLAGS(4); /* PF_R */
eh_frame_hdr PT_GNU_EH_FRAME;
-#ifdef BUILD_VDSO32
- vvar_sect PT_NULL FLAGS(4); /* PF_R */
- hpet_sect PT_NULL FLAGS(4); /* PF_R */
-#endif
}
--
1.9.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [tip:x86/vdso] x86, vdso: Make the vdso linker script compatible with Gold
2014-04-03 17:53 ` [PATCH] x86, vdso: Make the vdso linker script compatible with Gold Andy Lutomirski
@ 2014-04-03 19:16 ` tip-bot for Andy Lutomirski
0 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Andy Lutomirski @ 2014-04-03 19:16 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, luto, hpa, mingo, markus, tglx, hpa
Commit-ID: 378ed3ccd2a0404d031e771b65aa3af221ea8aea
Gitweb: http://git.kernel.org/tip/378ed3ccd2a0404d031e771b65aa3af221ea8aea
Author: Andy Lutomirski <luto@amacapital.net>
AuthorDate: Thu, 3 Apr 2014 10:53:43 -0700
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Thu, 3 Apr 2014 12:03:59 -0700
x86, vdso: Make the vdso linker script compatible with Gold
Gold can't parse the script due to:
https://sourceware.org/bugzilla/show_bug.cgi?id=16804
With a workaround in place for that issue, Gold 2.23 crashes due to:
https://sourceware.org/bugzilla/show_bug.cgi?id=15355
This works around the former bug and avoids the second by removing
the unnecessary vvar and hpet sections and segments. The vdso and
hpet symbols are still there, and nothing needed the sections or
segments.
Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Link: http://lkml.kernel.org/r/243fa205098d112ec759c9b1b26785c09f399833.1396547532.git.luto@amacapital.net
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
arch/x86/vdso/vdso-layout.lds.S | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/arch/x86/vdso/vdso-layout.lds.S b/arch/x86/vdso/vdso-layout.lds.S
index 2e263f3..9df017a 100644
--- a/arch/x86/vdso/vdso-layout.lds.S
+++ b/arch/x86/vdso/vdso-layout.lds.S
@@ -9,12 +9,9 @@ SECTIONS
#ifdef BUILD_VDSO32
#include <asm/vdso32.h>
- .hpet_sect : {
- hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE);
- } :text :hpet_sect
+ hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE);
- .vvar_sect : {
- vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE);
+ vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE);
/* Place all vvars at the offsets in asm/vvar.h. */
#define EMIT_VVAR(name, offset) vvar_ ## name = vvar + offset;
@@ -22,7 +19,6 @@ SECTIONS
#include <asm/vvar.h>
#undef __VVAR_KERNEL_LDS
#undef EMIT_VVAR
- } :text :vvar_sect
#endif
. = SIZEOF_HEADERS;
@@ -61,7 +57,12 @@ SECTIONS
*/
. = ALIGN(0x100);
- .text : { *(.text*) } :text =0x90909090
+ .text : { *(.text*) } :text =0x90909090,
+
+ /*
+ * The comma above works around a bug in gold:
+ * https://sourceware.org/bugzilla/show_bug.cgi?id=16804
+ */
/DISCARD/ : {
*(.discard)
@@ -84,8 +85,4 @@ PHDRS
dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
note PT_NOTE FLAGS(4); /* PF_R */
eh_frame_hdr PT_GNU_EH_FRAME;
-#ifdef BUILD_VDSO32
- vvar_sect PT_NULL FLAGS(4); /* PF_R */
- hpet_sect PT_NULL FLAGS(4); /* PF_R */
-#endif
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-04-03 19:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03 17:43 [PATCH] x86, vdso: Fix vdso-layout linker script Markus Trippelsdorf
2014-04-03 17:47 ` Andy Lutomirski
2014-04-03 17:53 ` [PATCH] x86, vdso: Make the vdso linker script compatible with Gold Andy Lutomirski
2014-04-03 19:16 ` [tip:x86/vdso] " tip-bot for Andy Lutomirski
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.