Option: --first
--first = section_id
This option places the selected input section first in its execution region. This can, for example,
place the section containing the vector table first in the image.
Syntax:
section_id is one of the following:
1) Symbol
Selects the section that defines symbol。You must not specify a symbol that has
more than one definition, because only one section can be placed first. For example: --first=reset
2) object(section)
Selects section from object. There must be no space between object and the
following open parenthesis. For example: --first=init.o(init)
3) object
Selects the single input section in object. If you use this short form and there is
more than one input section, the linker generates an error message. For example:
--first=init.o
Note: The --first option cannot be used with --scatter. Instead, use the +FIRST attribute in a
scatter-loading file.
Options: --entry
--entry=location
This option specifies the unique initial entry point of the image.
Syntax
location is one of the following:
1) entry_address
A numerical value, for example: --entry=0x0
2) symbol
Specifies an image entry point as the address of symbol, for example:--entry=reset_handler
3) offset+object(section)
Specifies an image entry point as an offset inside a section within a particular object, for example:
--entry=8+startup.o(startupseg)
There must be no spaces within the argument to --entry. The input section and object names are matched without case-sensitivity. You can use the following simplified notation:
• object(section), if offset is zero.
• object, if there is only one input section. armlink generates an error message if there is more than one code input section in object.
Note
1) If the entry address of your image is in Thumb state, then the least significant bit of the address must be set to 1. The linker does this automatically if you specify a symbol. For example, if the entry code starts at address 0x8000 in Thumb state you must use --entry=0x8001.
2) If you use --ltcg, then only --entry symbol can be used.
Usage
The image can contain multiple entry points, but the initial entry point specified with this option is stored in the executable file header for use by the loader. There can be only one occurrence of this option on the command line. A debugger typically uses this entry address to initialize the Program Counter (PC) when an image is loaded. The initial entry point must meet the following conditions:
• the image entry point must lie within an execution region
• the execution region must be non-overlay, and must be a root execution region (load address == execution address).
Refer to ARM Compiler toolchain v4.1 Linker Reference