Skip to content

Commit

Permalink
elfloder: simplify RISC-V linker script
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Heider <[email protected]>
  • Loading branch information
axel-h authored and kent-mcleod committed May 14, 2021
1 parent e0448b5 commit 6531c8e
Showing 1 changed file with 40 additions and 91 deletions.
131 changes: 40 additions & 91 deletions elfloader-tool/src/arch-riscv/linker.lds
Original file line number Diff line number Diff line change
Expand Up @@ -3,104 +3,53 @@
*
* SPDX-License-Identifier: GPL-2.0-only
*/
OUTPUT_ARCH( "riscv" )

OUTPUT_ARCH( "riscv" )
ENTRY( _start )

SECTIONS
{

/*--------------------------------------------------------------------*/
/* Code and read-only segment */
/*--------------------------------------------------------------------*/

/* Begining of code and text segment */
. = 0x0000000080400000;
_text = .;
/* . = 0x00000000ff000000; */
_ftext = .;
PROVIDE( eprol = . );


/* text: Program code section */
.start :
_text = .;
.start :
{
*(.text.start)
}

.text :
{
*(.text)
}

/* End of code and read-only segment */
PROVIDE( etext = . );
_etext = .;

/*--------------------------------------------------------------------*/
/* Initialized data segment */
/*--------------------------------------------------------------------*/

/* Start of initialized data segment */
. = ALIGN(16);
_fdata = .;

/* Start of data section */

_sdata = .;
.sdata : {
__global_pointer$ = . + 0x800;
*(.sdata*)
}
.srodata : {
*(.srodata*)
}

/* data: Writable data */
.data :
{
*(.data)
*(.data.*)
}

/* End of initialized data segment */
. = ALIGN(4);
PROVIDE( edata = . );
_edata = .;

/*--------------------------------------------------------------------*/
/* Uninitialized data segment */
/*--------------------------------------------------------------------*/

/* Start of uninitialized data segment */
. = .;
_fbss = .;

/* sbss: Uninitialized writeable small data section */
. = .;

/* bss: Uninitialized writeable data section */
. = .;
_bss = .;
.bss :
{
*(.bss)
*(.bss.*)
*(.sbss*)
}
_bss_end = .;

/* rodata: Read-only data */
.rodata :
{
*(.rodata)
*(.rodata.*)

. = ALIGN(8);
_archive_start = .;
*(._archive_cpio)
_archive_end = .;
}

_end = .;
.text :
{
*(.text)
}
. = ALIGN(16);
.rodata :
{
*(.srodata*)
. = ALIGN(16);
*(.rodata)
*(.rodata.*)
/*
* ld crashes when we add this here: *(_driver_list)
*/
. = ALIGN(16);
_archive_start = .;
*(._archive_cpio)
_archive_end = .;
}
. = ALIGN(16);
.data :
{
__global_pointer$ = . + 0x800;
*(.sdata*)
*(.data)
*(.data.*)
}
. = ALIGN(16);
.bss :
{
_bss = .;
*(.sbss*)
*(.bss)
*(.bss.*)
_bss_end = .;
}
_end = .;
}

0 comments on commit 6531c8e

Please sign in to comment.