1 Star 0 Fork 1

Sean / vscode-sylixos-template-bsp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
SylixOSBSP.ld 9.39 KB
一键复制 编辑 原始数据 按行查看 历史
Sean 提交于 2021-11-03 15:43 . first commit
/*********************************************************************************************************
**
** 中国软件开源组织
**
** 嵌入式实时操作系统
**
** SylixOS(TM)
**
** Copyright All Rights Reserved
**
**--------------文件信息--------------------------------------------------------------------------------
**
** 文 件 名: SylixOSBSP.ld
**
** 创 建 人: RealEvo-IDE
**
** 文件创建日期: 2021 年 11 月 03 日
**
** 描 述: BspDemo 链接脚本文件
*********************************************************************************************************/
/*********************************************************************************************************
包含配置文件
*********************************************************************************************************/
INCLUDE "config.lds"
/*********************************************************************************************************
链接配置
*********************************************************************************************************/
OUTPUT_FORMAT(elf64-littleaarch64) /* binary file format */
OUTPUT_ARCH(aarch64) /* target select */
/*********************************************************************************************************
段定义
*********************************************************************************************************/
SECTIONS
{
/*********************************************************************************************************
代码段 LMA == VMA == ORIGIN(TEXT)
*********************************************************************************************************/
.text : {
*(.vector)
*(.text)
*(.text.*) /* cpp namespace function */
*(.romrun) /* ROM 中必须的函数 */
*(.rodata) /* read-only data (constants) */
*(.rodata*)
*(.glue_7)
*(.glue_7t)
} > TEXT
/*********************************************************************************************************
GOT
*********************************************************************************************************/
.got : {
*(.got.plt)
*(.got)
} > TEXT
/*********************************************************************************************************
.ARM.exidx is sorted, so has to go in its own output section.
*********************************************************************************************************/
.ARM.exidx : {
. = ALIGN(4);
PROVIDE(__exidx_start = .);
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
. = ALIGN(4);
PROVIDE(__exidx_end = .);
} > TEXT
/*********************************************************************************************************
C++ 全局对象构造与析构函数表
这里放在 .text 和 .ARM.exidx 之后, .data 之前,
这里的 LMA 和 VMA 相同, 如果放在 .data 之后, LMA 与 VMA 不同, 则需要启动程序从装载区搬运到运行区
*********************************************************************************************************/
.ctors : {
. = ALIGN(8);
KEEP (*cppRtBegin*.o(.ctors))
KEEP (*(.preinit_array))
KEEP (*(.init_array))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
KEEP (*cppRtEnd*.o(.ctors))
} > TEXT
.dtors : {
. = ALIGN(8);
KEEP (*cppRtBegin*.o(.dtors))
KEEP (*(.fini_array))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
KEEP (*cppRtEnd*.o(.dtors))
} > TEXT
/*********************************************************************************************************
.data 段数据初始化内容放在这里
*********************************************************************************************************/
. = ALIGN(8);
PROVIDE (_etext = .);
/*********************************************************************************************************
数据段
.data 段运行地址 VMA 为 ORIGIN(DATA), 装载地址 LMA 为 _etext,
连接器会将 .data 的初始化数据放在 _etext 的地方, 然后启动程序必须将 _etext 的内容搬运到
VMA ORIGIN(DATA) 中. 大小等于 SIZEOF(.data)
*********************************************************************************************************/
.data ORIGIN(DATA) : AT (_etext) {
. = ALIGN(8);
PROVIDE (_data = .);
*(.data)
. = ALIGN(8);
PROVIDE (_edata = .);
} > DATA
/*********************************************************************************************************
清零段
NOLOAD 表示不装载, 启动程序只需要借助 __bss_start 和 __bss_end 两个符号指定的起始地址和结束地址
将 .bss 区域清零即可. (注意 *.noinit 可以不进行清零)
*********************************************************************************************************/
.bss (NOLOAD) : {
. = ALIGN(8);
*(.noinit)
. = ALIGN(8);
PROVIDE (__bss_start = .);
*(.bss)
. = ALIGN(8);
*(COMMON)
. = ALIGN(8);
PROVIDE (__bss_end = .);
} > DATA
/*********************************************************************************************************
栈段
SylixOS 启动时使用,异常入口也使用
*********************************************************************************************************/
.stack (NOLOAD) : {
. = ALIGN(16);
PROVIDE (__stack_start = .);
. += BOOT_STACK_SIZE;
. = ALIGN(16);
PROVIDE (__stack_end = .);
} > DATA
/*********************************************************************************************************
内核堆段
*********************************************************************************************************/
.heap (NOLOAD) : {
. = ALIGN(16);
PROVIDE (__heap_start = .);
PROVIDE (__heap_end = (ORIGIN(DATA) + LENGTH(DATA) - 128));
} > DATA
/*********************************************************************************************************
Stabs debugging sections
*********************************************************************************************************/
.stab 0 : {*(.stab) }
.stabstr 0 : {*(.stabstr) }
.stab.excl 0 : {*(.stab.excl) }
.stab.exclstr 0 : {*(.stab.exclstr) }
.stab.index 0 : {*(.stab.index) }
.stab.indexstr 0 : {*(.stab.indexstr) }
.comment 0 : {*(.comment) }
/*********************************************************************************************************
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0.
*********************************************************************************************************/
/*********************************************************************************************************
DWARF 1
*********************************************************************************************************/
.debug 0 : {*(.debug) }
.line 0 : {*(.line) }
/*********************************************************************************************************
GNU DWARF 1 extensions
*********************************************************************************************************/
.debug_srcinfo 0 : {*(.debug_srcinfo) }
.debug_sfnames 0 : {*(.debug_sfnames) }
/*********************************************************************************************************
DWARF 1.1 and DWARF 2
*********************************************************************************************************/
.debug_aranges 0 : {*(.debug_aranges) }
.debug_pubnames 0 : {*(.debug_pubnames) }
/*********************************************************************************************************
DWARF 2
*********************************************************************************************************/
.debug_info 0 : {*(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : {*(.debug_abbrev) }
.debug_line 0 : {*(.debug_line) }
.debug_frame 0 : {*(.debug_frame) }
.debug_str 0 : {*(.debug_str) }
.debug_loc 0 : {*(.debug_loc) }
.debug_macinfo 0 : {*(.debug_macinfo) }
/*********************************************************************************************************
SGI/MIPS DWARF 2 extensions
*********************************************************************************************************/
.debug_weaknames 0 : {*(.debug_weaknames) }
.debug_funcnames 0 : {*(.debug_funcnames) }
.debug_typenames 0 : {*(.debug_typenames) }
.debug_varnames 0 : {*(.debug_varnames) }
}
/*********************************************************************************************************
END
*********************************************************************************************************/
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/seanwoocode/vscode-sylixos-template-bsp.git
git@gitee.com:seanwoocode/vscode-sylixos-template-bsp.git
seanwoocode
vscode-sylixos-template-bsp
vscode-sylixos-template-bsp
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891