免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1215 | 回复: 1
打印 上一主题 下一主题

[内核入门] 懂 GNU 链接器的进来帮一下忙 [复制链接]

论坛徽章:
9
程序设计版块每日发帖之星
日期:2016-02-11 06:20:00程序设计版块每日发帖之星
日期:2016-02-14 06:20:00程序设计版块每日发帖之星
日期:2016-02-14 06:20:0015-16赛季CBA联赛之吉林
日期:2016-03-23 17:25:0015-16赛季CBA联赛之浙江
日期:2016-04-01 08:25:0615-16赛季CBA联赛之山西
日期:2016-04-01 10:09:1915-16赛季CBA联赛之广夏
日期:2016-06-03 15:58:212016科比退役纪念章
日期:2016-07-28 17:42:5215-16赛季CBA联赛之广东
日期:2017-02-20 23:32:43
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2016-08-09 11:05 |只看该作者 |正序浏览
在分析一个链接脚本的时候,有个地方看不懂,请大神赐教

__ksymtab       0 : { *(SORT(___ksymtab+*)) }

该指令中 “0” 的作用是什么?

论坛徽章:
20
程序设计版块每日发帖之星
日期:2015-08-17 06:20:00程序设计版块每日发帖之星
日期:2016-07-16 06:20:00程序设计版块每日发帖之星
日期:2016-07-18 06:20:00每日论坛发贴之星
日期:2016-07-18 06:20:00黑曼巴
日期:2016-12-26 16:00:3215-16赛季CBA联赛之江苏
日期:2017-06-26 11:05:5615-16赛季CBA联赛之上海
日期:2017-07-21 18:12:5015-16赛季CBA联赛之青岛
日期:2017-09-04 17:32:0515-16赛季CBA联赛之吉林
日期:2018-03-26 10:02:16程序设计版块每日发帖之星
日期:2016-07-15 06:20:0015-16赛季CBA联赛之江苏
日期:2016-07-07 18:37:512015亚冠之萨济拖拉机
日期:2015-08-17 12:21:08
2 [报告]
发表于 2016-08-16 16:14 |只看该作者
本帖最后由 nswcfd 于 2016-08-16 16:16 编辑
  1. 3.6.1 Output Section Description
  2. --------------------------------

  3. The full description of an output section looks like this:
  4.      SECTION [ADDRESS] [(TYPE)] :
  5.        [AT(LMA)]
  6.        [ALIGN(SECTION_ALIGN)]
  7.        [SUBALIGN(SUBSECTION_ALIGN)]
  8.        [CONSTRAINT]
  9.        {
  10.          OUTPUT-SECTION-COMMAND
  11.          OUTPUT-SECTION-COMMAND
  12.          ...
  13.        } [>REGION] [AT>LMA_REGION] [:PHDR :PHDR ...] [=FILLEXP]

  14.    Most output sections do not use most of the optional section
  15. attributes.

  16.    The whitespace around SECTION is required, so that the section name
  17. is unambiguous.  The colon and the curly braces are also required.  The
  18. line breaks and other white space are optional.

  19.    Each OUTPUT-SECTION-COMMAND may be one of the following:

  20.    * a symbol assignment (*note Assignments::)

  21.    * an input section description (*note Input Section::)

  22.    * data values to include directly (*note Output Section Data::)

  23.    * a special output section keyword (*note Output Section Keywords::)
复制代码
看起来像是ADDRESS
  1. 3.6.3 Output Section Address
  2. ----------------------------

  3. The ADDRESS is an expression for the VMA (the virtual memory address)
  4. of the output section.  If you do not provide ADDRESS, the linker will
  5. set it based on REGION if present, or otherwise based on the current
  6. value of the location counter.

  7.    If you provide ADDRESS, the address of the output section will be
  8. set to precisely that.  If you provide neither ADDRESS nor REGION, then
  9. the address of the output section will be set to the current value of
  10. the location counter aligned to the alignment requirements of the
  11. output section.  The alignment requirement of the output section is the
  12. strictest alignment of any input section contained within the output
  13. section.
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP