Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The GNU linker. - <b>the entry point</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
The Entry Point
===============

   The linker command language includes a command specifically for
defining the first executable instruction in an output file (its "entry
point").  Its argument is a symbol name:
     ENTRY(SYMBOL)

   Like symbol assignments, the `ENTRY' command may be placed either as
an independent command in the command file, or among the section
definitions within the `SECTIONS' command--whatever makes the most
sense for your layout.

   `ENTRY' is only one of several ways of choosing the entry point.
You may indicate it in any of the following ways (shown in descending
order of priority: methods higher in the list override methods lower
down).
   * the `-e' ENTRY command-line option;

   * the `ENTRY(SYMBOL)' command in a linker control script;

   * the value of the symbol `start', if present;

   * the address of the first byte of the `.text' section, if present;

   * The address `0'.

   For example, you can use these rules to generate an entry point with
an assignment statement: if no symbol `start' is defined within your
input files, you can simply define it, assigning it an appropriate
value--

     start = 0x2020;

The example shows an absolute address, but you can use any expression.
For example, if your input object files use some other symbol-name
convention for the entry point, you can just assign the value of
whatever symbol contains the start address to `start':

     start = other_symbol ;


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson