1  MEMORY command

  The MEMORY command describes the location and size of blocks of memory in the target. You can use it to describe which memory regions may be used by the linker, and which memory regions it must avoid.

  A linker script may contain at most one use of the MEMORY command. However, you can define as many blocks of memory within it as you wish. The syntax is:

     MEMORY
{
name [(attr)] : ORIGIN = origin, LENGTH = len
...
}

  The name is used to refer to the region. We can add later alias names to existing memory regions with REGION_ALIAS command.

  The attr string must consist only of the following characters:

    'R', Read-only section;  'W', Read/write section;  'X', Executable section

  The origin is for the start address of the memory region. The keyword ORIGIN may be abbreviated to org or o (but not, for example, ORG).

  The len is an expression for the size in bytes of the memory region. As with the origin expression, the expression must be numerical only and must evaluate to a constant. The keyword LENGTH may be abbreviated to len or l.

2  Example

     MEMORY
{
rom (rx) : ORIGIN = , LENGTH = 256K
ram (!rx) : org = 0x40000000, l = 4M
}

  There are two memory regions available for allocation: one starting at `0' for 256 kilobytes, and the other starting at `0x40000000' for four megabytes. The linker will place into the `rom' memory region every section which is not explicitly mapped into a memory region, and is either read-only or executable. The linker will place other sections which are not explicitly mapped into a memory region into the `ram' memory region.

Linker scripts之MEMORY的更多相关文章

  1. Linker scripts之Intro

    1 Intro Every link is controlled by a linker script. The main purpose of the linker script is to des ...

  2. Linker scripts之SECTIONS

    1 Purpose The linker script describes how the sections in the input files should be mapped into the ...

  3. openMSP430之Custom linker script

    The use of the -mmcu switch is of course NOT mandatory. It is simply a convenient way to use the pre ...

  4. A Sample Linker Script

    from:http://www.hertaville.com/a-sample-linker-script.html A sample script file that will work with ...

  5. linux内核的makefile.txt讲解

    linux内核的linux-3.6.5\Documentation\kbuild\makefiles.txt Linux Kernel Makefiles This document describe ...

  6. LPC18xx LPC43xx LPC4370 Bootrom USB DFU FPB - Flash Patch and Breakpoint Unit

    What is the difference between a Bootrom vs bootloader on ARM systems Bootrom Bootrom (or Boot ROM) ...

  7. Linux内核Makefile文件(翻译自内核手册)

    --译自Linux3.9.5 Kernel Makefiles(内核目录documention/kbuild/makefiles.txt) kbuild(kernel build) 内核编译器 Thi ...

  8. Linux Kernel的Makefile与Kconfig文件的语法

    https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt Introduction ------------ The c ...

  9. About Gnu Linker1

    1 OverView ld combines a number of object and archive files, relocates their data and ties up symbol ...

随机推荐

  1. 文件相关操作工具类——FileUtils.java

    文件相关操作的工具类,创建文件.删除文件.删除目录.复制.移动文件.获取文件路径.获取目录下文件个数等,满足大多数系统需求. 源码如下:(点击下载 FileUtils.java) import jav ...

  2. SQLServer2008 行转列

    with a as( select *,row_number() over(partition by hyid order by jp desc) rowid from rtc) select a.h ...

  3. js与flash结合使用

    最近,做个了一个falsh和js 通信的小东西. flash负责接收参数和返回结果.js负责处理信息,接收返回结果,将结果返回到服务器端. 听着很复杂,做起来页面还是很简单的.用的技术还是不少的,fl ...

  4. javascript callback函数的理解与使用

    最近做的一个项目中用到了callback函数,于是就研究了下总结下我对javascript callback的理解 首先从callback的字面翻译“回调” 可以理解这是一个函数被调用的机制 当我们遇 ...

  5. python 捕获 shell/bash 脚本的输出结果

    #!/usr/bin/python## get subprocess module import subprocess ## call date command ##p = subprocess.Po ...

  6. leetcode:Excel Sheet Column Number

    Given a column title as appear in an Excel sheet, return its corresponding column number. For exampl ...

  7. spring读写分离(配置多数据源)[marked]

    我们今天的主角是AbstractRoutingDataSource,在Spring2.0.1发布之后,引入了AbstractRoutingDataSource,使用该类可以实现普遍意义上的多数据源管理 ...

  8. css去掉a标签点击后的虚线框

    outline是css3的一个属性,用的很少. 声明,这是个不能兼容的css属性,在ie6.ie7.遨游浏览器都不兼容. outline控制的到底是什么呢? 当聚焦a标签的时候,在a标签的区域周围会有 ...

  9. 并行编译 Xoreax IncrediBuild

    好东西... http://pan.baidu.com/s/1BtZ4s

  10. a标签包input引起的问题

    最近公司中的一个项目中,有一个同事跟我说,他写的输入框不能选中输入内容了,并且光标也不能插入到已写好的文字其他位置. 简化了一下他的代码结构,如下: <a href="javascri ...