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. C# 设计基础(一)

    (一)   C#项目的组成结构 项目结构 .config ---配置文件(存放配置参数文件) .csproj ---项目文件(管理文件项) .sln   ---解决方案文件(管理项目) .cs   - ...

  2. PowerDesigner15.1创建模型及生成带注释sql操作手册

    转自:http://blog.csdn.net/huiwenjie168/article/details/7824029 一.创建模型 操作:file-->new Model… 快捷键:ctrl ...

  3. 《OD大数据实战》HBase入门实战

    官方参考文档:http://abloz.com/hbase/book.html#shell_tricks 1.2.3. Shell 练习 用shell连接你的HBase $ ./bin/hbase s ...

  4. $.getJSON ashx 跨域

    context.Response.AddHeader("Access-Control-Allow-Origin", "*");

  5. 线程——委托InvokeRequired和Invoke

    C#中禁止跨线程直接访问控件,InvokeRequired是为了解决这个问题而产生的,当一个控件的InvokeRequired属性值为真时,说明有一个创建它以外的线程想访问它.此时它将会在内部调用ne ...

  6. iOS9 class dump header

    获取系统私有API,网上有很多资料总结了一下就三种方式: 使用class-dump可以提取系统私有API列表 使用class-dump+DumpFrameworks.pl,这个可以一次性提取所有系统F ...

  7. 漫游Kafka设计篇之消息传输的事务定义

    之前讨论了consumer和producer是怎么工作的,现在来讨论一下数据传输方面.数据传输的事务定义通常有以下三种级别: 最多一次: 消息不会被重复发送,最多被传输一次,但也有可能一次不传输. 最 ...

  8. HDU 1728 逃离迷宫【BFS】

    题意:给出一个起点,一个终点,规定的转弯次数,问能否在规定的转弯次数内到达终点--- 这一题是学(看)习(题)的(解)@_@ 主要学了两个地方 一个是剪枝,如果搜到的当前点的转弯次数小于该点turn数 ...

  9. python numpy array 的一些问题

    1 将list转换成array 如果list的嵌套数组是不规整的,如 a = [[1,2], [3,4,5]] 则a = numpy.array(a)之后 a的type是ndarray,但是a中得元素 ...

  10. MIMO-OFDM通信系统学习笔记(一)

    [笔记一:单载波传输与多载波传输] MIMO-OFDM技术是3G-LTE,WiMAX通信系 统,以及WLan比如IEEE802.11a,IEEE802.11n等标准的关键技术,作为一枚通信狗,这些应该 ...