没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论



格式:pdf 资源大小:389.2KB 页数:96







格式:pdf 资源大小:3.1MB 页数:174





格式:pdf 资源大小:1.7MB 页数:21






格式:zip 资源大小:202.6MB


格式:docx 资源大小:185.5KB 页数:25








Using ld
The GNU linker
ld version 2
Version 2.11.90
Steve Chamberlain
Ian Lance Taylor

Red Hat Inc
Using LD, the GNU linker
Edited by Jeffrey Osier (jeffrey@cygnus.com)
Copyright
c
1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of
the GNU Free Documentation License, Version 1.1 or any later version published by the
Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with
no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free
Documentation License".

Chapter 1: Overview 1
1 Overview
ld combines a number of object and archive files, relocates their data and ties up symbol
references. Usually the last step in compiling a program is to run ld.
ld accepts Linker Command Language files written in a superset of AT&T’s Link Editor
Command Language syntax, to provide explicit and total control over the linking pro c es s.
This version of ld uses the general purpose BFD libraries to operate on object files. This
allows ld to read, combine, and write object files in many different formats—for example,
COFF or a.out. Different formats may be linked together to produce any available kind of
object file. See Chapter 5 [BFD], page 57, for more information.
Aside from its flexibility, the gnu linker is more helpful than other linkers in providing
diagnostic information. Many linkers abandon execution immediately upon encountering
an error; whenever possible, ld continues executing, allowing you to identify other errors
(or, in some cases, to get an output file in spite of the error).

2 Using LD, the GNU linker

Chapter 2: Invocation 3
2 Invocation
The gnu linker ld is meant to cover a broad range of situations, and to be as compatible
as possible with other linkers. As a result, you have many choices to control its behavior.
2.1 Command Line Options
The linker supports a plethora of command-line options, but in actual practice few of them
are used in any particular context. For instance, a frequent use of ld is to link standard
Unix object files on a standard, supported Unix system. On such a system, to link a file
hello.o:
ld -o output /lib/crt0.o hello.o -lc
This tells ld to produce a file called output as the result of linking the file /lib/crt0.o
with hello.o and the library libc.a, which will come from the standard search directories.
(See the discussion of the ‘-l’ option below.)
Some of the command-line options to ld may be specified at any point in the command
line. However, options which refer to files, such as ‘-l’ or ‘-T’, cause the file to be read at
the point at which the option appears in the command line, relative to the object files and
other file options. Repeating non-file options with a different argument will either have no
further effect, or override prior occurrences (those further to the left on the command line)
of that option. Options which may be meaningfully specified more than once are noted in
the descriptions below.
Non-option arguments are object files or archives which are to be linked together. They
may follow, precede, or be mixed in with command-line options, except that an object file
argument may not be placed between an option and its argument.
Usually the linker is invoked with at least one object file, but you can specify other forms
of binary input files using ‘-l’, ‘-R’, and the script command language. If no binary input
files at all are specified, the linker does not produce any output, and iss ues the message ‘No
input files’.
If the linker can not recognize the format of an object file, it will assume that it is a linker
script. A script specified in this way augments the main linker script used for the link
(either the default linker script or the one specified by using ‘-T’). This feature permits
the linker to link against a file which appears to be an object or an archive, but actually
merely defines some s ymbol values, or uses INPUT or GROUP to load other objects. Note that
specifying a script in this way should only be used to augment the main linker script; if
you want to use some command that logically can only appear once, such as the SECTIONS
or MEMORY command, you must replace the default linker script using the ‘-T’ option. See
Chapter 3 [Scripts], page 25.
For options whose names are a single letter, option arguments must either follow the op-
tion letter without intervening whitespace, or be given as separate arguments immediately
following the option that requires them.
For options whose names are multiple letters, either one dash or two can precede the option
name; for example, ‘-trace-symbol’ and ‘--trace-symbol’ are equivalent. Note - there is
one exception to this rule. Multiple letter options that start with a lower case ’o’ can only be
preceeded by two dashes. This is to reduce confusion with the ‘-o’ option. So for example
剩余83页未读,继续阅读
资源评论

- wraithx2014-08-04推荐,pdf带目录,字迹清晰,用语准确,可以结合中文资料对比阅读!

人生为棋我愿为卒行动虽慢未曾后退
- 粉丝: 58
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 中学校园网站的方案设计书(1).doc
- 数据库自治技术架构解读.pptx
- 算法工程师的个人简历模板.doc
- 基于单片机的步进电机控制系统方案设计书03085.doc
- 单片机原理及接口技术课程设计.doc
- 云计算背景下计算机安全问题及对策.docx
- 专业定制级别互联网电商推广宣传创业计划书优秀ppt模板课件【精选模板】.ppt
- 2014年度混凝土与水泥制品行业技术革新奖获奖项目管理展示(五).doc
- 定向增发项目管理收益率的二因子分解模型及溢价率的项目管理质地假说.doc
- 信息化施工组织设计专业技术方案.doc
- 基于云计算的虚拟化实验室设计与实现.docx
- 芜湖铁画在互联网时代下的发展出路探析.docx
- 2017公需课《网络效应》和《专业技术人员知识重点创造与经营》练习题答案.doc
- 互联网+背景下的情景式和互动式教学模式探究.docx
- 新形势下计算机网络信息安全存在的威胁及对策分析.docx
- JAVA网吧管理.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
