summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2001-09-21 05:43:38 +0000
committerjake <jake@FreeBSD.org>2001-09-21 05:43:38 +0000
commit297dc90746f0278c0b594f39111f30765eaca913 (patch)
tree26728ecf265d93f204cd1acf990cdf1e0570d782
parent433cddbe87f578961cdd60486ae4353148b52a9c (diff)
downloadFreeBSD-src-297dc90746f0278c0b594f39111f30765eaca913.zip
FreeBSD-src-297dc90746f0278c0b594f39111f30765eaca913.tar.gz
Add kernbase symbol and use it instead of magic numbers in the
linker script.
-rw-r--r--sys/conf/ldscript.sparc648
-rw-r--r--sys/sparc64/sparc64/genassym.c2
-rw-r--r--sys/sparc64/sparc64/locore.S3
-rw-r--r--sys/sparc64/sparc64/locore.s3
4 files changed, 12 insertions, 4 deletions
diff --git a/sys/conf/ldscript.sparc64 b/sys/conf/ldscript.sparc64
index 8afcbeb..0f0093a 100644
--- a/sys/conf/ldscript.sparc64
+++ b/sys/conf/ldscript.sparc64
@@ -9,7 +9,7 @@ ENTRY(_start)
SECTIONS
{
/* Read-only sections, merged into text segment: */
- . = 0x400000 + SIZEOF_HEADERS;
+ . = kernbase + SIZEOF_HEADERS;
.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
@@ -128,7 +128,7 @@ SECTIONS
.init :
{
KEEP (*(.init))
- } = 0x400000
+ } =0x1000000
.text :
{
*(.trap)
@@ -138,11 +138,11 @@ SECTIONS
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.gnu.linkonce.t.*)
- } = 0x400000
+ } =0x1000000
.fini :
{
KEEP (*(.fini))
- } = 0x400000
+ } =0x1000000
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
diff --git a/sys/sparc64/sparc64/genassym.c b/sys/sparc64/sparc64/genassym.c
index 6039621..6994188 100644
--- a/sys/sparc64/sparc64/genassym.c
+++ b/sys/sparc64/sparc64/genassym.c
@@ -58,6 +58,8 @@
#include <machine/tsb.h>
#include <machine/tstate.h>
+ASSYM(KERNBASE, KERNBASE);
+
/*
* XXX: gas, as of version 2.11.2, does not know this ASI (and some other
* UltraSparc specific ones). This definition will probably get us into trouble
diff --git a/sys/sparc64/sparc64/locore.S b/sys/sparc64/sparc64/locore.S
index 34a9d6f..fabc03e 100644
--- a/sys/sparc64/sparc64/locore.S
+++ b/sys/sparc64/sparc64/locore.S
@@ -33,6 +33,9 @@
#include "assym.s"
+ .globl kernbase
+ .set kernbase,KERNBASE
+
/*
* void _start(struct bootinfo *bi, u_long ofw_vec)
*/
diff --git a/sys/sparc64/sparc64/locore.s b/sys/sparc64/sparc64/locore.s
index 34a9d6f..fabc03e 100644
--- a/sys/sparc64/sparc64/locore.s
+++ b/sys/sparc64/sparc64/locore.s
@@ -33,6 +33,9 @@
#include "assym.s"
+ .globl kernbase
+ .set kernbase,KERNBASE
+
/*
* void _start(struct bootinfo *bi, u_long ofw_vec)
*/
OpenPOWER on IntegriCloud