vmlinux.lds.h 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <asm/page.h>
  3. /*
  4. * .boot.data section is shared between the decompressor code and the
  5. * decompressed kernel. The decompressor will store values in it, and copy
  6. * over to the decompressed image before starting it.
  7. *
  8. * .boot.data variables are kept in separate .boot.data.<var name> sections,
  9. * which are sorted by alignment first, then by name before being merged
  10. * into single .boot.data section. This way big holes cased by page aligned
  11. * structs are avoided and linker produces consistent result.
  12. */
  13. #define BOOT_DATA \
  14. . = ALIGN(PAGE_SIZE); \
  15. .boot.data : { \
  16. __boot_data_start = .; \
  17. *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.boot.data*))) \
  18. __boot_data_end = .; \
  19. }
  20. /*
  21. * .boot.preserved.data is similar to .boot.data, but it is not part of the
  22. * .init section and thus will be preserved for later use in the decompressed
  23. * kernel.
  24. */
  25. #define BOOT_DATA_PRESERVED \
  26. . = ALIGN(PAGE_SIZE); \
  27. .boot.preserved.data : { \
  28. __boot_data_preserved_start = .; \
  29. *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.boot.preserved.data*))) \
  30. __boot_data_preserved_end = .; \
  31. }