mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-01-22 01:30:31 -05:00
1. miss debug info in assembly code
RISC-V-spike-htif_GCC
LDFLAGS add arch and abi info for linker
for riscv64-unknown-elf multilib, if there is no arch and abi
info, will link to default lib and have below error
target emulation `elf32-littleriscv' does not match `elf64-littleriscv'
use CFLAGS to replace ASFLAGS when compile assembly code
because DEBUG flag is added in CFLAGS, if we use ASFLAGS to compile
assembly code, there is no debug info in assembly code objfile
2. binutils 2.39 ld warn 'has a LOAD segment with RWX permissions'
RISC-V-Qemu-virt_GCC
RISC-V-spike-htif_GCC
RISC-V_RV32_QEMU_VIRT_GCC
3. fix build fail
RISC-V_RV32_QEMU_VIRT_GCC
Signed-off-by: Eric Chan <e14002270@gmail.com>
116 lines
1.6 KiB
Text
116 lines
1.6 KiB
Text
OUTPUT_ARCH( "riscv" )
|
|
ENTRY( _start )
|
|
|
|
MEMORY
|
|
{
|
|
/* Fake ROM area */
|
|
rom (rxa) : ORIGIN = 0x80000000, LENGTH = 512K
|
|
ram (wxa) : ORIGIN = 0x80080000, LENGTH = 512K
|
|
}
|
|
|
|
SECTIONS
|
|
{
|
|
.init :
|
|
{
|
|
_text = .;
|
|
KEEP (*(SORT_NONE(.init)))
|
|
} >rom AT>rom
|
|
|
|
.text :
|
|
{
|
|
*(.text.unlikely .text.unlikely.*)
|
|
*(.text.startup .text.startup.*)
|
|
*(.text .text.*)
|
|
*(.gnu.linkonce.t.*)
|
|
} >rom AT>rom
|
|
|
|
.fini :
|
|
{
|
|
KEEP (*(SORT_NONE(.fini)))
|
|
_etext = .;
|
|
} >rom AT>rom
|
|
|
|
.rodata.align ALIGN(4):
|
|
{
|
|
_rodata = .;
|
|
} >rom AT>rom
|
|
|
|
.rodata.start :
|
|
{
|
|
_rodata_lma = LOADADDR(.rodata.start);
|
|
} >rom AT>rom
|
|
|
|
.rodata :
|
|
{
|
|
*(.rdata)
|
|
*(.rodata .rodata.*)
|
|
*(.gnu.linkonce.r.*)
|
|
|
|
. = ALIGN(4);
|
|
_erodata = .;
|
|
} >rom AT>rom
|
|
|
|
.data.align :
|
|
{
|
|
. = ALIGN(4);
|
|
_data = .;
|
|
} >ram AT>rom
|
|
|
|
.data.start :
|
|
{
|
|
_data_lma = LOADADDR(.data.start);
|
|
} >ram AT>rom
|
|
|
|
.data :
|
|
{
|
|
*(.data .data.*)
|
|
*(.gnu.linkonce.d.*)
|
|
. = ALIGN(8);
|
|
PROVIDE( __global_pointer$ = . + 0x800 );
|
|
*(.sdata .sdata.*)
|
|
*(.sdata2 .sdata2.*)
|
|
*(.gnu.linkonce.s.*)
|
|
. = ALIGN(8);
|
|
*(.srodata.cst16)
|
|
*(.srodata.cst8)
|
|
*(.srodata.cst4)
|
|
*(.srodata.cst2)
|
|
*(.srodata .srodata.*)
|
|
|
|
. = ALIGN(4);
|
|
_edata = .;
|
|
} >ram AT>rom
|
|
|
|
.bss.align :
|
|
{
|
|
. = ALIGN(4);
|
|
_bss = .;
|
|
} >ram AT>rom
|
|
|
|
.bss.start :
|
|
{
|
|
_bss_lma = LOADADDR(.bss.start);
|
|
} >ram AT>rom
|
|
|
|
.bss :
|
|
{
|
|
*(.sbss*)
|
|
*(.gnu.linkonce.sb.*)
|
|
*(.bss .bss.*)
|
|
*(.gnu.linkonce.b.*)
|
|
*(COMMON)
|
|
|
|
. = ALIGN(4);
|
|
_ebss = .;
|
|
} >ram AT>rom
|
|
|
|
. = ALIGN(8);
|
|
_end = .;
|
|
|
|
.stack :
|
|
{
|
|
. = ALIGN(16);
|
|
. += __stack_size;
|
|
_stack_top = .;
|
|
} >ram AT>ram
|
|
}
|