Red Hat ENTERPRISE LINUX 3 - USING ID Using Instructions page 24

Using ld, the gnu linker
Hide thumbs Also See for ENTERPRISE LINUX 3 - USING ID:
Table of Contents

Advertisement

20
extern int i;
An undefined reference, which does not allocate space. There must be either a definition or
a common symbol for the variable somewhere.
int i;
A common symbol. If there are only (one or more) common symbols for a variable, it goes
in the uninitialized data area of the output file. The linker merges multiple common symbols
for the same variable into a single symbol. If they are of different sizes, it picks the largest
size. The linker turns a common symbol into a declaration, if there is a definition of the
same variable.
The
-warn-common
of lines: the first describes the symbol just encountered, and the second describes the previous
symbol encountered with the same name. One or both of the two symbols will be a common
symbol.
1. Turning a common symbol into a reference, because there is already a definition for the
symbol.
(
file
section
overridden by definition
(
file
section
2. Turning a common symbol into a reference, because a later definition for the symbol is
encountered. This is the same as the previous case, except that the symbols are encountered
in a different order.
(
file
section
overriding common
(
file
section
3. Merging a common symbol with a previous same-sized common symbol.
(
file
section
of '
symbol
(
file
section
4. Merging a common symbol with a previous larger common symbol.
(
file
section
overridden by larger common
(
file
section
5. Merging a common symbol with a previous smaller common symbol. This is the same as
the previous case, except that the symbols are encountered in a different order.
(
file
section
overriding smaller common
(
file
section
-warn-constructors
Warn if any global constructors are used. This is only useful for a few object file formats. For
formats like COFF or ELF, the linker can not detect the use of global constructors.
-warn-multiple-gp
Warn if multiple global pointer values are required in the output file. This is only meaningful for
certain processors, such as the Alpha. Specifically, some processors put large-valued constants
in a special section. A special register (the global pointer) points into the middle of this section,
so that constants can be loaded efficiently via a base-register relative addressing mode. Since the
offset in base-register relative mode is fixed and relatively small (e.g., 16 bits), this limits the
maximum size of the constant pool. Thus, in large programs, it is often necessary to use multiple
global pointer values in order to be able to address all possible constants. This option causes a
warning to be issued whenever this case occurs.
option can produce five kinds of warnings. Each warning consists of a pair
): warning: common of '
): warning: defined here
): warning: definition of '
): warning: common is here
): warning: multiple common
'
): warning: previous common is here
): warning: common of '
): warning: larger common is here
): warning: common of '
): warning: smaller common is here
'
symbol
'
symbol
'
symbol
'
symbol
Chapter 3. Invocation

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents