ld
ld
ld
ld 中文使用手册完全版 (
(
(
( 译 )-
)-
)-
)-
1
1
1
1
、概述 ..............................................................................................................................................................................................
..............................................................................................................................................................................................
..............................................................................................................................................................................................
.............................................................................................................................................................................................. 4
4
4
4
2
2
2
2
、命令行选项 ..................................................................................................................................................................................
..................................................................................................................................................................................
..................................................................................................................................................................................
.................................................................................................................................................................................. 5
5
5
5
2.1
2.1
2.1
2.1
、连接器提供大量的命令行选项 ......................................................................................................................................... 5
2.2
2.2
2.2
2.2
、连接脚本 ............................................................................................................................................................................. 5
2.3
2.3
2.3
2.3
、对于名称是单个字符的选项 ............................................................................................................................................. 5
2.4
2.4
2.4
2.4
、对于名称是多个字符的选项
,
,
,
,
选项前可以有一个或两个破折号
;
;
;
;
................................................................................... 5
2.5
、 多字符选项的参数 .............................................................................................................................................................. 5
2.5
2.5
2.5
2.5
、如果连接器通过,被编译器驱动来间接引用
(
(
(
(
比如
GCC
GCC
GCC
GCC ),
),
),
),
............................................................................................ 6
2.5.1
2.5.1
2.5.1
2.5.1
、被
GNU
GNU
GNU
GNU
连接器接受的常用命令行开关的一个列表 ............................................................................................. 6
`-aKEYWORD'
`-aKEYWORD'
`-aKEYWORD'
`-aKEYWORD'
..................................................................................................................................................................................... 6
`-AARCHITECTURE'`--architecture=ARCHITECTURE'
`-AARCHITECTURE'`--architecture=ARCHITECTURE'
`-AARCHITECTURE'`--architecture=ARCHITECTURE'
`-AARCHITECTURE'`--architecture=ARCHITECTURE'
................................................................................................ 6
`-b
`-b
`-b
`-b INPUT-formAT'`--format=INPUT-formAT'
INPUT-formAT'`--format=INPUT-formAT'
INPUT-formAT'`--format=INPUT-formAT'
INPUT-formAT'`--format=INPUT-formAT'
............................................................................................................... 6
`-cMRI-COMMANDFILE'
`-cMRI-COMMANDFILE'
`-cMRI-COMMANDFILE'
`-cMRI-COMMANDFILE'
................................................................................................................................................................ 6
`-d'`-dc'`-dp'
`-d'`-dc'`-dp'
`-d'`-dc'`-dp'
`-d'`-dc'`-dp'
..................................................................................................................................................................................... 6
`-e
`-e
`-e
`-e ENTRY'`--entry=ENTRY'
ENTRY'`--entry=ENTRY'
ENTRY'`--entry=ENTRY'
ENTRY'`--entry=ENTRY'
...................................................................................................................................................... 6
`-E'`--export-dynamic'
`-E'`--export-dynamic'
`-E'`--export-dynamic'
`-E'`--export-dynamic'
................................................................................................................................................................. 6
`-EB'
`-EB'
`-EB'
`-EB' 连接 big-endian 对象 . 会影响缺省输出格式 .
................................................................................................................... 7
`-EL'
`-EL'
`-EL'
`-EL' 连接 little-endian 对象 . 会影响缺省输出格式 .
................................................................................................................ 7
`-g'
`-g'
`-g'
`-g' 忽略 . 为了跟其它工具兼容而提供 .
........................................................................................................................................... 7
`-i'
`-i'
`-i'
`-i' 执行一个增量连接 ( 跟 '-r' 等同 )
.................................................................................................................................................. 7
`-init
`-init
`-init
`-init NAME'
NAME'
NAME'
NAME'
......................................................................................................................................................................................... 7
`-lARCHIVE'`--library=ARCHIVE'
`-lARCHIVE'`--library=ARCHIVE'
`-lARCHIVE'`--library=ARCHIVE'
`-lARCHIVE'`--library=ARCHIVE'
........................................................................................................................................... 7
`-M'`--print-map'
`-M'`--print-map'
`-M'`--print-map'
`-M'`--print-map' 打印一个连接位图到标准输出
....................................................................................................................... 7
`-n'`--nmagic'
`-n'`--nmagic'
`-n'`--nmagic'
`-n'`--nmagic' ,
.............................................................................................................................................................................. 7
`-N'`--omagic'
`-N'`--omagic'
`-N'`--omagic'
`-N'`--omagic'
................................................................................................................................................................................... 7
`--no-omagic'
`--no-omagic'
`--no-omagic'
`--no-omagic'
..................................................................................................................................................................................... 7
`-o
`-o
`-o
`-o OUTPUT'`--output=OUTPUT'
OUTPUT'`--output=OUTPUT'
OUTPUT'`--output=OUTPUT'
OUTPUT'`--output=OUTPUT'
............................................................................................................................................ 7
`-O
`-O
`-O
`-O LEVEL'
LEVEL'
LEVEL'
LEVEL'
............................................................................................................................................................................................ 7
`-q'`--emit-relocs'
`-q'`--emit-relocs'
`-q'`--emit-relocs'
`-q'`--emit-relocs'
........................................................................................................................................................................... 7
`-r'`--relocateable'
`-r'`--relocateable'
`-r'`--relocateable'
`-r'`--relocateable'
......................................................................................................................................................................... 7
`-R
`-R
`-R
`-R FILENAME'`--just-symbols=FILENAME'
FILENAME'`--just-symbols=FILENAME'
FILENAME'`--just-symbols=FILENAME'
FILENAME'`--just-symbols=FILENAME'
.................................................................................................................... 8
`-s'`--strip-all'
`-s'`--strip-all'
`-s'`--strip-all'
`-s'`--strip-all' , 忽略输出文件中所有的符号信息 .
......................................................................................................................... 8
`-S'`--strip-debug'
`-S'`--strip-debug'
`-S'`--strip-debug'
`-S'`--strip-debug' 忽略输出文件中所有的调试符号信息 ( 但不是所有符号 ).
.......................................................................... 8
`-t'`--trace'
`-t'`--trace'
`-t'`--trace'
`-t'`--trace' , 打印 ld 处理的所有输入文件的名字 .
.......................................................................................................................... 8
`-T
`-T
`-T
`-T SCRIPTFILE'`--script=SCRIPTFILE'
SCRIPTFILE'`--script=SCRIPTFILE'
SCRIPTFILE'`--script=SCRIPTFILE'
SCRIPTFILE'`--script=SCRIPTFILE'
.............................................................................................................................. 8
`-u
`-u
`-u
`-u SYMBOL'`--undefined=SYMBOL'
SYMBOL'`--undefined=SYMBOL'
SYMBOL'`--undefined=SYMBOL'
SYMBOL'`--undefined=SYMBOL'
.................................................................................................................................... 8
`-Ur'
`-Ur'
`-Ur'
`-Ur'
......................................................................................................................................................................................................... 8
`--unique[=SECTION]'
`--unique[=SECTION]'
`--unique[=SECTION]'
`--unique[=SECTION]'
.................................................................................................................................................................. 8
`-v'
`-v'
`-v'
`-v' `--version'
`--version'
`--version'
`--version' `-V'
`-V'
`-V'
`-V'
.................................................................................................................................................................... 8
`-x'
`-x'
`-x'
`-x' `--discard-all'
`--discard-all'
`--discard-all'
`--discard-all' 删除所有的本地符号 .
................................................................................................................................ 8
`-X'
`-X'
`-X'
`-X' `--discard-locals'
`--discard-locals'
`--discard-locals'
`--discard-locals'
................................................................................................................................................................ 8
`-y
`-y
`-y
`-y SYMBOL'
SYMBOL'
SYMBOL'
SYMBOL' `--trace-symbol=SYMBOL'
`--trace-symbol=SYMBOL'
`--trace-symbol=SYMBOL'
`--trace-symbol=SYMBOL'
......................................................................................................................... 8