Doc:Elf:Sections

From GNU 68HC11/HC12
(Difference between revisions)
Jump to: navigation, search
(Fix indentation)
 
Line 8: Line 8:
 
   <TR><TD><b>.text</b></TD>
 
   <TR><TD><b>.text</b></TD>
 
       <TD>This is the standard text section for code program.
 
       <TD>This is the standard text section for code program.
      By default, the linker places the text at 0x8000. This can
+
By default, the linker places the text at 0x8000. This can
      be overridden with <b>-Ttext</b> option.
+
be overridden with <b>-Ttext</b> option.
 
       </TD>
 
       </TD>
 
   </TR>
 
   </TR>
 
   <TR><TD><b>.rodata</b></TD>
 
   <TR><TD><b>.rodata</b></TD>
 
       <TD>This is the standard read-only data section. It is placed
 
       <TD>This is the standard read-only data section. It is placed
      after the text section by the linker.
+
after the text section by the linker.
 
       </TD>
 
       </TD>
 
   </TR>
 
   </TR>
Line 23: Line 23:
 
   <TR><TD><b>.bss</b></TD>
 
   <TR><TD><b>.bss</b></TD>
 
       <TD>This is the standard bss section. It appears after the
 
       <TD>This is the standard bss section. It appears after the
      data section.
+
data section.
 
       </TD>
 
       </TD>
 
   </TR>
 
   </TR>
 
   <TR><TD><b>.page0</b></TD>
 
   <TR><TD><b>.page0</b></TD>
 
       <TD>This is a specific section for the 68HC1x to represent the
 
       <TD>This is a specific section for the 68HC1x to represent the
      page 0. It is intended to be used to help in specifying data
+
page 0. It is intended to be used to help in specifying data
      which are defined in the first 256-bytes (page 0) of the address
+
which are defined in the first 256-bytes (page 0) of the address
      space. It is placed at address 0 by the linker. It is treated as
+
space. It is placed at address 0 by the linker. It is treated as
      a .data section.
+
a .data section.
 
       </TD>
 
       </TD>
 
   </TR>
 
   </TR>
 
   <TR><TD><b>.eeprom</b></TD>
 
   <TR><TD><b>.eeprom</b></TD>
 
       <TD>This is a specific section for the 68HC1x to represent the
 
       <TD>This is a specific section for the 68HC1x to represent the
      internal EEPROM.
+
internal EEPROM.
 
       </TD>
 
       </TD>
 
   </TR>
 
   </TR>
 
   <TR><TD><b>.install[0-4]</b></TD>
 
   <TR><TD><b>.install[0-4]</b></TD>
 
       <TD>These sections represent some initialization sections.
 
       <TD>These sections represent some initialization sections.
      They are used by the GCC startup code. Some of them are for
+
They are used by the GCC startup code. Some of them are for
      used by applications. During the final link, these sections
+
used by applications. During the final link, these sections
      are merged with the <b>.text</b> section, and are put at
+
are merged with the <b>.text</b> section, and are put at
      beginning. Therefore, they appear at beginning of ROM area.
+
beginning. Therefore, they appear at beginning of ROM area.
      The <b>.install0</b> is reserved. It initializes the stack pointer.
+
The <b>.install0</b> is reserved. It initializes the stack pointer.
      The <b>.install1</b> is a placeholder for applications.
+
The <b>.install1</b> is a placeholder for applications.
      The <b>.install2</b> is reserved.  It initializes the bss and
+
The <b>.install2</b> is reserved.  It initializes the bss and
      data sections. The <b>.install3</b> is a placeholder for applications.
+
data sections. The <b>.install3</b> is a placeholder for applications.
      The <b>.install4</b> is reserved and invokes the main.
+
The <b>.install4</b> is reserved and invokes the main.
 
       </TD>
 
       </TD>
 
   </TR>
 
   </TR>
 
   <TR><TD><b>.fini[0-4]</b></TD>
 
   <TR><TD><b>.fini[0-4]</b></TD>
      <TD>These sections represent some termination sections.
+
    <TD>These sections represent some termination sections.
      They are used by the GCC finish code (<b>exit</b>). Some of them are for
+
They are used by the GCC finish code (<b>exit</b>). Some of them are for
      used by applications. During the final link, these sections
+
used by applications. During the final link, these sections
      are merged with the <b>.text</b> section. <b>.fini0</b> and <b>
+
are merged with the <b>.text</b> section. <b>.fini0</b> and <b>
      .fini4</b> are reserved.  <b>.fini1</b> is a placeholder for
+
.fini4</b> are reserved.  <b>.fini1</b> is a placeholder for
      applications.  It can contain code which is executed during exit
+
applications.  It can contain code which is executed during exit
      and before the C++ static destructors.  <b>.fini2</b> is reserved
+
and before the C++ static destructors.  <b>.fini2</b> is reserved
      and corresponds to the C++ static destructors.  <b>.fini3</b> is
+
and corresponds to the C++ static destructors.  <b>.fini3</b> is
      a placeholder for applications.  This code is executed after
+
a placeholder for applications.  This code is executed after
      the C++ static destructors are called.  The <b>.fini4</b> is
+
the C++ static destructors are called.  The <b>.fini4</b> is
      reserved and corresponds to the runtime exit.
+
reserved and corresponds to the runtime exit.
 
       </TD>
 
       </TD>
 
   </TR>
 
   </TR>
 
   <TR><TD><b>.vectors</b></TD>
 
   <TR><TD><b>.vectors</b></TD>
 
       <TD>This is a specific section for the 68HC1x to represent the
 
       <TD>This is a specific section for the 68HC1x to represent the
      vectors table. By default the vectors table is located at 0xffc0
+
vectors table. By default the vectors table is located at 0xffc0
      and placed at that address by the linker. By using the
+
and placed at that address by the linker. By using the
      <b>-defsym vectors_addr=<i>addr</i></b> linker option, it is
+
<b>-defsym vectors_addr=<i>addr</i></b> linker option, it is
      possible to set another address for the vectors table. For
+
possible to set another address for the vectors table. For
      example, <b>-defsym vectors_addr=0xbfc0</b> sets the vectors
+
example, <b>-defsym vectors_addr=0xbfc0</b> sets the vectors
      table at 0xbfc0.
+
table at 0xbfc0.
 
       </TD>
 
       </TD>
 
   </TR>
 
   </TR>
 
   <TR><TD><b>.softregs</b></TD>
 
   <TR><TD><b>.softregs</b></TD>
 
       <TD>This is a specific section for the 68HC1x to hold the
 
       <TD>This is a specific section for the 68HC1x to hold the
      gcc soft registers.  For 68HC11, this section is put during the
+
gcc soft registers.  For 68HC11, this section is put during the
      final link in the <b>.page0</b> section.  For 68HC12, it is
+
final link in the <b>.page0</b> section.  For 68HC12, it is
      put in the <b>.bss</b> section.
+
put in the <b>.bss</b> section.
 
       </TD>
 
       </TD>
 
   </TR>
 
   </TR>
Line 86: Line 86:
 
   <TR><TD><i>others</i></TD>
 
   <TR><TD><i>others</i></TD>
 
       <TD>Several standard sections exists for DWARF-2 debugging info,
 
       <TD>Several standard sections exists for DWARF-2 debugging info,
      stack frame unwinding description and so on.
+
stack frame unwinding description and so on.
 
       </TD>
 
       </TD>
 
   </TR>
 
   </TR>
 
</TABLE>
 
</TABLE>

Latest revision as of 23:08, 31 January 2006

ELF sections are defined to organize and classify the data: code, data, readonly data, specific data.

Section Description
.text This is the standard text section for code program.

By default, the linker places the text at 0x8000. This can be overridden with -Ttext option.

.rodata This is the standard read-only data section. It is placed

after the text section by the linker.

.data This is the standard data section.
.bss This is the standard bss section. It appears after the

data section.

.page0 This is a specific section for the 68HC1x to represent the

page 0. It is intended to be used to help in specifying data which are defined in the first 256-bytes (page 0) of the address space. It is placed at address 0 by the linker. It is treated as a .data section.

.eeprom This is a specific section for the 68HC1x to represent the

internal EEPROM.

.install[0-4] These sections represent some initialization sections.

They are used by the GCC startup code. Some of them are for used by applications. During the final link, these sections are merged with the .text section, and are put at beginning. Therefore, they appear at beginning of ROM area. The .install0 is reserved. It initializes the stack pointer. The .install1 is a placeholder for applications. The .install2 is reserved. It initializes the bss and data sections. The .install3 is a placeholder for applications. The .install4 is reserved and invokes the main.

.fini[0-4] These sections represent some termination sections.

They are used by the GCC finish code (exit). Some of them are for used by applications. During the final link, these sections are merged with the .text section. .fini0 and .fini4 are reserved. .fini1 is a placeholder for applications. It can contain code which is executed during exit and before the C++ static destructors. .fini2 is reserved and corresponds to the C++ static destructors. .fini3 is a placeholder for applications. This code is executed after the C++ static destructors are called. The .fini4 is reserved and corresponds to the runtime exit.

.vectors This is a specific section for the 68HC1x to represent the

vectors table. By default the vectors table is located at 0xffc0 and placed at that address by the linker. By using the -defsym vectors_addr=addr linker option, it is possible to set another address for the vectors table. For example, -defsym vectors_addr=0xbfc0 sets the vectors table at 0xbfc0.

.softregs This is a specific section for the 68HC1x to hold the

gcc soft registers. For 68HC11, this section is put during the final link in the .page0 section. For 68HC12, it is put in the .bss section.

others Several standard sections exists for DWARF-2 debugging info,

stack frame unwinding description and so on.

Personal tools