Buddy_Zhang1 发表于 2016-08-09 11:05

懂 GNU 链接器的进来帮一下忙

在分析一个链接脚本的时候,有个地方看不懂,请大神赐教

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

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

nswcfd 发表于 2016-08-16 16:14

本帖最后由 nswcfd 于 2016-08-16 16:16 编辑

3.6.1 Output Section Description
--------------------------------

The full description of an output section looks like this:
   SECTION [(TYPE)] :
      
      
      
      
       {
         OUTPUT-SECTION-COMMAND
         OUTPUT-SECTION-COMMAND
         ...
       } [>REGION] [:PHDR :PHDR ...] [=FILLEXP]

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

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

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

   * a symbol assignment (*note Assignments::)

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

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

   * a special output section keyword (*note Output Section Keywords::)看起来像是ADDRESS3.6.3 Output Section Address
----------------------------

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

   If you provide ADDRESS, the address of the output section will be
set to precisely that.If you provide neither ADDRESS nor REGION, then
the address of the output section will be set to the current value of
the location counter aligned to the alignment requirements of the
output section.The alignment requirement of the output section is the
strictest alignment of any input section contained within the output
section.
页: [1]
查看完整版本: 懂 GNU 链接器的进来帮一下忙