Doc:Elf:Sections

From GNU 68HC11/HC12
Jump to: navigation, search

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