[LinkerScript.4] 簡單的連結器指令碼命令: 入口
阿新 • • 發佈:2019-02-14
Setting the Entry Point
設定入口點The first instruction to execute in a program is called the entry point. You can use the ENTRY
linker script command to set the entry point. The argument
is a symbol name:
ENTRY(symbol)
在程式中執行的第一條指令被稱為入口點.你可以使用 ENTRY 連結器指令碼命令設定入口點.它的引數是一個符號名稱.
There are several ways to set the entry point. The linker will set the entry point by trying each of the following methods in order, and stopping when one of them succeeds:
有一些方法可以用來設定入口點. 連結器將依序按照如下方法設定入口點, 直到它們當中有一種方法設定入口點成功為止.
- the ‘-e’ entry command-line option;
- the
ENTRY(
symbol)
command in a linker script; - the value of a target specific symbol, if it is defined; For many targets this is
start
, but PE and BeOS based systems for example check a list of possible entry symbols, matching the first one found. - the address of the first byte of the ‘.text’ section, if present;
- The address
0
.
- entry命令列選項‘ -e '
- 連結器指令碼中的命令 ENTRY(symbol)
- 若有定義時,一個目標規定符號的值;對於很多目標來說,它是start。但是象基於PE和BeOS系統會去檢查一組可能的入口符號,一般會匹配第一個發現的.
- 如果存在,'.text' section的第一位元組的地址
- 地址為0