- 论坛徽章:
- 0
|
下边这段是info ld里边的文档,一直没有看懂他的意思,哪位能解释一下。
PS:网上的ld中文版本里边,到这个地方就没有翻译了。郁闷。。。。
DATA_SEGMENT_ALIGN(maxpagesize, commonpagesize)
This is equivalent to either
(ALIGN(maxpagesize) + (. & (maxpagesize - 1)))
or
(ALIGN(maxpagesize) + (. & (maxpagesize - commonpagesize)))
depending on whether the latter uses fewer commonpagesize sized pages for the data segment (area between the result of this expression and DATA_SEGMENT_END) than the former or not. If the latter form is used, it means commonpagesize bytes of runtime memory will be saved at the expense of up to commonpagesize wasted bytes in the on-disk file.
This expression can only be used directly in SECTIONS commands, not in any output section descriptions and only once in the linker script. commonpagesize should be less or equal to maxpagesize and should be the system page size the object wants to be optimized for (while still working on system page sizes up to maxpagesize).
Example:
. = DATA_SEGMENT_ALIGN(0x10000, 0x2000);
DATA_SEGMENT_END(exp)
This defines the end of data segment for DATA_SEGMENT_ALIGN evaluation purposes.
. = DATA_SEGMENT_END(.); |
|