Chinaunix首页 | 论坛 | 博客
  • 博客访问: 646421
  • 博文数量: 263
  • 博客积分: 9025
  • 博客等级: 中将
  • 技术积分: 2567
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-01 17:42
文章分类

全部博文(263)

文章存档

2012年(4)

2011年(64)

2010年(47)

2009年(44)

2008年(99)

2007年(5)

我的朋友

分类:

2011-04-27 17:19:27

Link Script

1.程序入口
  1)命令行"-e"参数指定的入口
  2)ENTRY(symbol)
  3)定义的start符号地址
  4).text正文的第一个字节
  5)地址 0.

2.SECTIONS command
  SECTIONS
  {
     sections-command
     sections-command
      ...
  }
 
  Each sections-command may be one of the following:
    * an ENTRY command
    * a symbol assignment
    * an output section description
    * an overlay description

3. Output sections description

   section [address] [(type)] : [AT(lma)]
   {
      output-section-command
      output-section-command
      ...
   } [>region] [AT>lma_region] [:phdr :phdr  ...] [=fillexp]

   Each output-section-command may be one of the following:
       * a symbol assignment
       * an input section description
       * data value to include directly
       * a special output section keyword

4. Output section type
     * NOLOAD    The section should be marked as not loadable, so that it will not be loaded into memory when

the program is run.
     * DSECT
     * COPY
     * INFO
     * OVERLAY    Rarely used.

5. Output section LMA
   The linker will normall set the LMA equal to the VMA.
   Use AT keyword to change that.
   The expression lma that follows the AT keyword specifies the load address for the section's load address.
   Alternatively "AT>lma_region" specify a memory region for the section's load address.
   This feature is designed to make it easy to build a ROM image.

6. Output section region
   Use ">region" to assign a section to a previously defined region of memory.

7. Ouput section phdr
   ":phdr" is used to assign a section to a previously defined program segment.
阅读(1005) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~