博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ARM GCC linker 脚本介绍
阅读量:4137 次
发布时间:2019-05-25

本文共 1583 字,大约阅读时间需要 5 分钟。

1. Reference

arm-2011.03/share/doc/arm-arm-none-eabi/pdf/ld.pdf

2. An example

OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")

/* Use OUTPUT_FORMAT with three arguments to use different formats based

on the ‘-EB’ and ‘-EL’ command line options. This permits the linker script to
set the output format based on the desired endianness.*/

MEMORY

{
rom (rx)  : ORIGIN = 0x00000000, LENGTH = 0x00008000
ram (rwx) : ORIGIN = 0x10000000, LENGTH = 0x00002000
}
/* Program code and read-only data go into the ROM. Read-write data goes into
the RAM. An image of the initialized data is loaded into the ROM and will be
copied during system start into the RAM.

*/

/* Section Definitions */ 
SECTIONS 
    .text : 
    { 
        KEEP(*(.isr_vector .isr_vector.*)) 
        *(.text .text.* .gnu.linkonce.t.*)      
        *(.glue_7t) *(.glue_7)                
        *(.rodata .rodata* .gnu.linkonce.r.*)                      
    } > rom

    .ARM.extab : 

    {
        *(.ARM.extab* .gnu.linkonce.armextab.*)
    } > rom
    
    .ARM.exidx :
    {
        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
    } > rom

    . = ALIGN(4); 

    _etext = .;

/* Program code */

    _sidata = .; 
/* Initialized data is  at _sidata */
    .data : AT (_etext) 
    { 
        _sdata = .; 
        *(.data .data.*) 
        . = ALIGN(4); 
        _edata = . ;
    } > ram

/*  Initialized data will be
copied during system start into the RAM */

    /* .bss section which is used for uninitialized data */ 
    .bss (NOLOAD) : 
    { 
        _sbss = . ; 
        *(.bss .bss.*) 
        *(COMMON) 
        . = ALIGN(4); 
        _ebss = . ; 
    } > ram
    

/*  None initialized  data will be

placed to the RAM */

    /* stack section */

    .co_stack (NOLOAD):
    {
        . = ALIGN(8);
        *(.co_stack .co_stack.*)
    } > ram

/*  Other ram are used as stack */
       

    . = ALIGN(4); 
    _end = . ; 

转载地址:http://kgmvi.baihongyu.com/

你可能感兴趣的文章
js报错显示subString/subStr is not a function
查看>>
高德地图js API实现鼠标悬浮于点标记时弹出信息窗体显示详情,点击点标记放大地图操作
查看>>
初始化VUE项目报错
查看>>
vue项目使用安装sass
查看>>
HTTP和HttpServletRequest 要点
查看>>
在osg场景中使用GLSL语言——一个例子
查看>>
laravel 修改api返回默认的异常处理
查看>>
laravel事务
查看>>
【JavaScript 教程】浏览器—History 对象
查看>>
这才是学习Vite2的正确姿势!
查看>>
7 个适用于所有前端开发人员的很棒API,你需要了解一下
查看>>
25个构建Web项目的HTML建议,你需要了解一下!
查看>>
【web素材】02-10款大气的购物商城网站模板
查看>>
6种方式实现JavaScript数组扁平化(flat)方法的总结
查看>>
如何实现a===1 && a===2 && a===3返回true?
查看>>
49个在工作中常用且容易遗忘的CSS样式清单整理
查看>>
20种在学习编程的同时也可以在线赚钱的方法
查看>>
隐藏搜索框:CSS 动画正反向序列
查看>>
12 个JavaScript 特性技巧你可能从未使用过
查看>>
127个超级实用的JavaScript 代码片段,你千万要收藏好(上)
查看>>