From a03f751e5ae42760e26ff81af989bbecb14303e9 Mon Sep 17 00:00:00 2001 From: Jake Burkholder Date: Mon, 6 Aug 2001 02:18:39 +0000 Subject: [PATCH] Add code model medlow to cflags and move the kernel load address from just before the memory hole to 4 megs. Special case building exception.s like locore.s, it needs to at the beginning so the branches out from the trap table don't overflow. --- sys/conf/Makefile.sparc64 | 9 ++++++--- sys/conf/files.sparc64 | 6 +++--- sys/conf/ldscript.sparc64 | 8 ++++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/conf/Makefile.sparc64 b/sys/conf/Makefile.sparc64 index 94b7769dfab0..84ffd5f12cb6 100644 --- a/sys/conf/Makefile.sparc64 +++ b/sys/conf/Makefile.sparc64 @@ -65,7 +65,7 @@ INCLUDES+= -I/usr/include .endif COPTS= ${INCLUDES} ${IDENT} -D_KERNEL -include opt_global.h -CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} +CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} -mcmodel=medlow # XXX LOCORE means "don't declare C stuff" not "for locore.s". ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} @@ -99,9 +99,9 @@ NORMAL_M= perl5 $S/kern/makeobjops.pl -c $<; \ GEN_CFILES= $S/$M/$M/genassym.c SYSTEM_CFILES= vnode_if.c hints.c config.c -SYSTEM_SFILES= $S/$M/$M/locore.s +SYSTEM_SFILES= $S/$M/$M/locore.s $S/$M/$M/exception.s SYSTEM_DEP= Makefile ${SYSTEM_OBJS} -SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} hints.o config.o hack.So +SYSTEM_OBJS= locore.o exception.o vnode_if.o ${OBJS} hints.o config.o hack.So SYSTEM_LD= @${LD} ${FMT} -Bdynamic -T $S/conf/ldscript.$M \ -export-dynamic -dynamic-linker /red/herring \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o @@ -178,6 +178,9 @@ kernel-clobber: locore.o: $S/$M/$M/locore.s assym.s ${NORMAL_S} +exception.o: $S/$M/$M/exception.s assym.s + ${NORMAL_S} + # This is a hack. BFD "optimizes" away dynamic mode if there are no # dynamic references. We could probably do a '-Bforcedynamic' mode like # in the a.out ld. For now, this works. diff --git a/sys/conf/files.sparc64 b/sys/conf/files.sparc64 index 3938690a7b65..594f4d796fad 100644 --- a/sys/conf/files.sparc64 +++ b/sys/conf/files.sparc64 @@ -16,10 +16,10 @@ sparc64/sparc64/db_disasm.c optional ddb sparc64/sparc64/db_interface.c optional ddb sparc64/sparc64/db_trace.c optional ddb sparc64/sparc64/elf_machdep.c standard -# locore.s needs to be handled in Makefile to put it first. Otherwise it's -# now normal. +# locore.s and exception.s need to be handled in Makefile to put them first. +# Otherwise it's they're normal. # sparc64/sparc64/locore.s standard -sparc64/sparc64/exception.s standard +# sparc64/sparc64/exception.s standard sparc64/sparc64/fp.c standard sparc64/sparc64/machdep.c standard sparc64/sparc64/pmap.c standard diff --git a/sys/conf/ldscript.sparc64 b/sys/conf/ldscript.sparc64 index cc65cd463f38..8afcbebed909 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: */ - . = 0x60000000000 + SIZEOF_HEADERS; + . = 0x400000 + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } @@ -128,7 +128,7 @@ SECTIONS .init : { KEEP (*(.init)) - } = 0x60000000000 + } = 0x400000 .text : { *(.trap) @@ -138,11 +138,11 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.gnu.linkonce.t.*) - } = 0x60000000000 + } = 0x400000 .fini : { KEEP (*(.fini)) - } = 0x60000000000 + } = 0x400000 PROVIDE (__etext = .); PROVIDE (_etext = .); PROVIDE (etext = .);