Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 378ed3cc authored by Andy Lutomirski's avatar Andy Lutomirski Committed by H. Peter Anvin
Browse files

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: default avatarMarkus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
Link: http://lkml.kernel.org/r/243fa205098d112ec759c9b1b26785c09f399833.1396547532.git.luto@amacapital.net


Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent 37c97554
Loading
Loading
Loading
Loading
+8 −11
Original line number Original line Diff line number Diff line
@@ -9,11 +9,8 @@ SECTIONS
#ifdef BUILD_VDSO32
#ifdef BUILD_VDSO32
#include <asm/vdso32.h>
#include <asm/vdso32.h>


	.hpet_sect : {
	hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE);
	hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE);
	} :text :hpet_sect


	.vvar_sect : {
	vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE);
	vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE);


	/* Place all vvars at the offsets in asm/vvar.h. */
	/* Place all vvars at the offsets in asm/vvar.h. */
@@ -22,7 +19,6 @@ SECTIONS
#include <asm/vvar.h>
#include <asm/vvar.h>
#undef __VVAR_KERNEL_LDS
#undef __VVAR_KERNEL_LDS
#undef EMIT_VVAR
#undef EMIT_VVAR
	} :text :vvar_sect
#endif
#endif
	. = SIZEOF_HEADERS;
	. = SIZEOF_HEADERS;


@@ -61,7 +57,12 @@ SECTIONS
	 */
	 */
	. = ALIGN(0x100);
	. = 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/ : {
		*(.discard)
		*(.discard)
@@ -84,8 +85,4 @@ PHDRS
	dynamic		PT_DYNAMIC	FLAGS(4);		/* PF_R */
	dynamic		PT_DYNAMIC	FLAGS(4);		/* PF_R */
	note		PT_NOTE		FLAGS(4);		/* PF_R */
	note		PT_NOTE		FLAGS(4);		/* PF_R */
	eh_frame_hdr	PT_GNU_EH_FRAME;
	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
}
}