Expressions In Linker Scripts; Constants; Symbol Names - Red Hat ENTERPRISE LINUX 3 - USING ID Using Instructions

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

Advertisement

Chapter 4. Linker Scripts
51
If you wish to bind a reference to a specific version of the symbol within the shared library, you can
use the aliases of convenience (i.e.,
), or you can use the
directive to specifically
old_foo
.symver
bind to an external version of the function in question.
You can also specify the language in the version script:
VERSION extern "lang" { version-script-commands }
The supported
s are
,
, and
. The linker will iterate over the list of symbols at the
lang
C
C++
Java
link time and demangle them according to
before matching them to the patterns specified in
lang
.
version-script-commands

4.10. Expressions in Linker Scripts

The syntax for expressions in the linker script language is identical to that of C expressions. All
expressions are evaluated as integers. All expressions are evaluated in the same size, which is 32 bits
if both the host and target are 32 bits, and is otherwise 64 bits.
You can use and set symbol values in expressions.
The linker defines several special purpose builtin functions for use in expressions.

4.10.1. Constants

All constants are integers.
As in C, the linker considers an integer beginning with
to be octal, and an integer beginning with
0
0x
or
to be hexadecimal. The linker considers other integers to be decimal.
0X
In addition, you can use the suffixes
and
to scale a constant by
or
respectively.
K
M
1024
1024*1024
For example, the following all refer to the same quantity:
_fourk_1 = 4K;
_fourk_2 = 4096;
_fourk_3 = 0x1000;

4.10.2. Symbol Names

Unless quoted, symbol names start with a letter, underscore, or period and may include letters, digits,
underscores, periods, and hyphens. Unquoted symbol names must not conflict with any keywords.
You can specify a symbol which contains odd characters or has the same name as a keyword by
surrounding the symbol name in double quotes:
"SECTION" = 9;
"with a space" = "also with a space" + 10;
Since symbols can contain many non-alphabetic characters, it is safest to delimit symbols with spaces.
For example,
is one symbol, whereas
is an expression involving subtraction.
A-B
A - B

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents