Linker scripts之MEMORY
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的更多相关文章
- Linker scripts之Intro
1 Intro Every link is controlled by a linker script. The main purpose of the linker script is to des ...
- Linker scripts之SECTIONS
1 Purpose The linker script describes how the sections in the input files should be mapped into the ...
- 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 ...
- A Sample Linker Script
from:http://www.hertaville.com/a-sample-linker-script.html A sample script file that will work with ...
- linux内核的makefile.txt讲解
linux内核的linux-3.6.5\Documentation\kbuild\makefiles.txt Linux Kernel Makefiles This document describe ...
- 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) ...
- Linux内核Makefile文件(翻译自内核手册)
--译自Linux3.9.5 Kernel Makefiles(内核目录documention/kbuild/makefiles.txt) kbuild(kernel build) 内核编译器 Thi ...
- Linux Kernel的Makefile与Kconfig文件的语法
https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt Introduction ------------ The c ...
- About Gnu Linker1
1 OverView ld combines a number of object and archive files, relocates their data and ties up symbol ...
随机推荐
- 谈谈防止Ajax重复点击提交
首先说说防止重复点击提交是什么意思. 我们在访问有的网站,输入表单完成以后,单击提交按钮进行提交以后,提交按钮就会变为灰色,用户不能再单击第二次,直到重新加载页面或者跳转.这样,可以一定程度上防止用户 ...
- 如何理解JAVA的跨平台特性
1.java的跨平台,是指java在运行时是凌驾于os之上,是在jvm中运行的,跟os没有直接联系. 2.java跨平台主要是由java的编译方式决定的,因为java是通过jvm先编译再执行,它编译的 ...
- js和 jquery对象
核心提示:jquery选择器得到的jquery对象和标准的 javascript中的document.getElementById()取得的dom对象是两种不同的对象类型,一般情况下,如S(’#id’ ...
- [转]深入hibernate的三种状态
学过hibernate的人都可能都知道hibernate有三种状态,transient(瞬时状态),persistent(持久化状态)以及detached(离线状态),大家伙也许也知道这三者之间的区别 ...
- 3D volume texture和cube map
cube map texture可以理解为6个面的纸盒, sample的时候使用vector射线型的sample. volume texture可以理解是一摞2D texture,sample的时候用 ...
- 【Scala学习笔记】第01弹——Scala安装与配置
安装Scala之前先要安装JDK(1.5以上),最好安装JDK 1.8+,安装好JDK后配置JDK的环境变量. 然后去Scala官网(http://www.scala-lang.org/downloa ...
- hdu1828(线段树+扫描线)
又知道了线段树的一种用法,除了单点更新,区间更新,还有这种在一段线段上标号但不往下推. 真是神奇 hdu1828 #include <iostream> #include <stdi ...
- SQL计算实际工作日(天)及两个时间(工作日)间隔(小时)!
Code highlighting produced by Actipro CodeHighlighter (freeware)-->去掉法定节假日(周六,周天)和指定节假日 USE [DBNa ...
- hdu 4614 pieces 状态DP
题意:给你一个长度小于等于16的字符串,每次可以删除一个回文传,问你最少删除干净的字数. 状态+dp dp[i] = min(dp[i],dp[j]+dp[j^i]);(j是i的字串): 连接:htt ...
- WM8962 HPOUT 信号强度 时间周期
/*************************************************************************** * WM8962 HPOUT 信号强度 时间周 ...