06.02.2013 Views

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

ARM Compiler toolchain Using the Linker - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.9 Image entry points<br />

4.9.1 See also<br />

Image structure and generation<br />

An entry point in an image is a location where program execution can start. There are two<br />

distinct types of entry point:<br />

Initial entry point<br />

The initial entry point for an image is a single value that is stored in <strong>the</strong> ELF<br />

header file. For programs loaded into RAM by an operating system or boot loader,<br />

<strong>the</strong> loader starts <strong>the</strong> image execution by transferring control to <strong>the</strong> initial entry<br />

point in <strong>the</strong> image.<br />

An image can have only one initial entry point. The initial entry point can be, but<br />

is not required to be, one of <strong>the</strong> entry points set by <strong>the</strong> ENTRY directive.<br />

Entry points set by <strong>the</strong> ENTRY directive<br />

You can select one of many possible entry points for an image. An image can have<br />

only one entry point.<br />

You create entry points in objects with <strong>the</strong> ENTRY directive in an assembler file. In<br />

embedded systems, this directive is typically used to mark code that is entered<br />

through <strong>the</strong> processor exception vectors, such as RESET, IRQ, and FIQ.<br />

The directive marks <strong>the</strong> output code section with an ENTRY keyword that instructs<br />

<strong>the</strong> linker not to remove <strong>the</strong> section when it performs unused section elimination.<br />

For C and C++ programs, <strong>the</strong> __main() function in <strong>the</strong> C library is also an entry<br />

point.<br />

If an embedded image is to be used by a loader, it must have a single initial entry<br />

point specified in <strong>the</strong> header. Use <strong>the</strong> --entry command-line option to select <strong>the</strong><br />

entry point.<br />

Tasks<br />

• About specifying an initial entry point on page 4-18.<br />

Reference<br />

<strong>Linker</strong> Reference:<br />

• --entry=location on page 2-58.<br />

Assembler Reference:<br />

• ENTRY on page 6-65.<br />

<strong>ARM</strong> DUI 0474C Copyright © 2010-2011 <strong>ARM</strong>. All rights reserved. 4-17<br />

ID080411 Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!