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

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

Advertisement

Chapter 4. Linker Scripts
ALIGN(
)
exp
Return the location counter (
value of the location counter--it just does arithmetic on it. Here is an example which aligns the
output
section to the next
.data
variable within the section to the next
SECTIONS { ...
.data ALIGN(0x2000): {
*(.data)
variable = ALIGN(0x8000);
}
... }
The first use of
as the optional
Description). The second use of
The builtin function
BLOCK(
)
exp
This is a synonym for
when setting the address of an output section.
DATA_SEGMENT_ALIGN(
This is equivalent to either
(ALIGN(
maxpagesize
or
(ALIGN(
maxpagesize
depending on whether the latter uses fewer
(area between the result of this expression and
the latter form is used, it means
expense of up to
This expression can only be used directly in
descriptions and only once in the linker script.
maxpagesize
still working on system page sizes up to
Example:
. = DATA_SEGMENT_ALIGN(0x10000, 0x2000);
DATA_SEGMENT_END(
This defines the end of data segment for
. = DATA_SEGMENT_END(.);
DEFINED(
)
symbol
Return 1 if
symbol
can use this function to provide default values for symbols. For example, the following script
fragment shows how to set a global symbol
if a symbol called
SECTIONS { ...
.text : {
begin = DEFINED(begin) ? begin : . ;
...
}
...
}
) aligned to the next
.
0x2000
in this example specifies the location of a section because it is used
ALIGN
attribute of a section definition (refer to Section 4.6.3 Output Section
address
ALIGN
is closely related to
NEXT
, for compatibility with older linker scripts. It is most often seen
ALIGN
,
maxpagesize
) + (. & (
) + (. & (
commonpagesize
commonpagesize
and should be the system page size the object wants to be optimized for (while
)
exp
is in the linker global symbol table and is defined, otherwise return 0. You
already existed, its value is preserved:
begin
exp
byte boundary after the preceding section and sets a
boundary after the input sections:
0x8000
is used to defines the value of a symbol.
.
ALIGN
)
commonpagesize
- 1)))
maxpagesize
-
maxpagesize
commonpagesize
commonpagesize
DATA_SEGMENT_END
bytes of runtime memory will be saved at the
wasted bytes in the on-disk file.
SECTIONS
commonpagesize
).
maxpagesize
DATA_SEGMENT_ALIGN
to the first location in the
begin
boundary.
doesn't change the
ALIGN
)))
sized pages for the data segment
) than the former or not. If
commands, not in any output section
should be less or equal to
evaluation purposes.
.text
55
section--but

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 3 - USING ID and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Enterprise linux 3

Table of Contents