Avoid hardcoding the kernel link address in the linker script.
Use KERNBASE instead. While here, move the text sections forward to the beginning of the text segment.
This commit is contained in:
parent
4c2d7071c5
commit
8678a43066
@ -10,7 +10,20 @@ PROVIDE (__stack = 0);
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = 0x00100000 + SIZEOF_HEADERS;
|
||||
|
||||
. = kernbase + SIZEOF_HEADERS;
|
||||
|
||||
.text :
|
||||
{
|
||||
*(.text)
|
||||
*(.stub)
|
||||
/* .gnu.warning sections are handled specially by elf32.em. */
|
||||
*(.gnu.warning)
|
||||
*(.gnu.linkonce.t*)
|
||||
} =0
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
@ -37,15 +50,7 @@ SECTIONS
|
||||
.rela.sbss : { *(.rela.sbss) }
|
||||
.rela.sdata2 : { *(.rela.sdata2) }
|
||||
.rela.sbss2 : { *(.rela.sbss2) }
|
||||
.text :
|
||||
{
|
||||
*(.text)
|
||||
/* .gnu.warning sections are handled specially by elf32.em. */
|
||||
*(.gnu.warning)
|
||||
*(.gnu.linkonce.t*)
|
||||
} =0
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
|
||||
.init : { *(.init) } =0
|
||||
.fini : { *(.fini) } =0
|
||||
.rodata : { *(.rodata) *(.gnu.linkonce.r*) }
|
||||
|
@ -71,6 +71,12 @@
|
||||
#define GET_CPUINFO(r) \
|
||||
mfsprg0 r
|
||||
|
||||
/*
|
||||
* Compiled KERNBASE location and the kernel load address
|
||||
*/
|
||||
.globl kernbase
|
||||
.set kernbase, KERNBASE
|
||||
|
||||
/*
|
||||
* Globals
|
||||
*/
|
||||
|
@ -152,4 +152,5 @@ ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
|
||||
|
||||
ASSYM(SF_UC, offsetof(struct sigframe, sf_uc));
|
||||
|
||||
ASSYM(KERNBASE, KERNBASE);
|
||||
ASSYM(MAXCOMLEN, MAXCOMLEN);
|
||||
|
Loading…
Reference in New Issue
Block a user