|
发表于 2006-7-23 22:03:35
|
显示全部楼层
from `info ld`:
`ALIGN(EXP)'
Return the location counter (`.') aligned to the next EXP boundary.
`ALIGN' doesn't change the value of the location counter--it just
does arithmetic on it. Here is an example which aligns the output
`.data' section to the next `0x2000' byte boundary after the
preceding section and sets a variable within the section to the
next `0x8000' boundary after the input sections:
SECTIONS { ...
.data ALIGN(0x2000): {
*(.data)
variable = ALIGN(0x8000);
}
... }
The first use of `ALIGN' in this example specifies the location of
a section because it is used as the optional ADDRESS attribute of
a section definition (*note Output Section Address:. The second
use of `ALIGN' is used to defines the value of a symbol.
The builtin function `NEXT' is closely related to `ALIGN'. |
|