NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-alpha/57701: alpha kernel is built with RWX segment



The following reply was made to PR port-alpha/57701; it has been noted by GNATS.

From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: thorpej%NetBSD.org@localhost
Subject: Re: port-alpha/57701: alpha kernel is built with RWX segment
Date: Sat, 18 Nov 2023 03:53:37 +0000

 This is a multi-part message in MIME format.
 --=_fvz4bw6Sgb7EvIjKFB6Nr1oMeWUc8Daj
 
 Attached draft patch attempts to fix this -- not yet compile-tested.
 
 --=_fvz4bw6Sgb7EvIjKFB6Nr1oMeWUc8Daj
 Content-Type: text/plain; charset="ISO-8859-1"; name="alpharwxldscript"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="alpharwxldscript.patch"
 
 From b1662f8a75d78b3a04afd0f967561f8c5d8e4412 Mon Sep 17 00:00:00 2001
 From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
 Date: Sat, 18 Nov 2023 03:45:01 +0000
 Subject: [PATCH] alpha: Split kernel into RX, R-only, and RW segments.
 
 PR port-alpha/57701
 
 XXX pullup-10
 XXX pullup-9
 ---
  sys/arch/alpha/conf/kern.ldscript | 23 +++++++++++++++--------
  1 file changed, 15 insertions(+), 8 deletions(-)
 
 diff --git a/sys/arch/alpha/conf/kern.ldscript b/sys/arch/alpha/conf/kern.l=
 dscript
 index 1f14867634c3..e403140d73fc 100644
 --- a/sys/arch/alpha/conf/kern.ldscript
 +++ b/sys/arch/alpha/conf/kern.ldscript
 @@ -20,14 +20,14 @@ SECTIONS
  		*(.text)
  		*(.text.*)
  		*(.stub)
 -	} =3D0x47ff041f
 +	} :rxmain =3D0x47ff041f
  	_etext =3D . ;
  	PROVIDE (etext =3D .);
 =20
  	.rodata	:
  	{
  		*(.rodata .rodata.*)
 -	}
 +	} :romain
 =20
  	.data	:
  	{
 @@ -41,7 +41,7 @@ SECTIONS
 =20
  		. =3D ALIGN(COHERENCY_UNIT);
  		*(.data.*)
 -	}
 +	} :rwmain
 =20
  	/*
  	 * Small-data located along side GOT and small-bss for
 @@ -51,12 +51,12 @@ SECTIONS
  	.got	:
  	{
  		*(.got)
 -	}
 +	} :rwmain
 =20
  	.sdata	:
  	{
  		*(.sdata .sdata.*)
 -	}
 +	} :rwmain
  	_edata =3D . ;
  	PROVIDE (edata =3D .) ;
 =20
 @@ -66,13 +66,13 @@ SECTIONS
  	{
  		*(.sbss .sbss.*)
  		*(.scommon)
 -	}
 +	} :rwmain
 =20
  	.bss	:
  	{
  		*(.bss .bss.*)
  		*(COMMON)
 -	}
 +	} :rwmain
 =20
  	/* End of the kernel image */
  	__kernel_end =3D . ;
 @@ -82,5 +82,12 @@ SECTIONS
  	.note.netbsd.ident :
  	{
  		KEEP(*(.note.netbsd.ident));
 -	}
 +	} :romain
 +}
 +
 +PHDRS
 +{
 +	rxmain PT_LOAD;
 +	romain PT_LOAD;
 +	rwmain PT_LOAD;
  }
 
 --=_fvz4bw6Sgb7EvIjKFB6Nr1oMeWUc8Daj--
 


Home | Main Index | Thread Index | Old Index