module.lds.S 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Common module linker script, always used when linking a module.
  3. * Archs are free to supply their own linker scripts. ld will
  4. * combine them automatically.
  5. */
  6. #include <asm/page.h>
  7. SECTIONS {
  8. /DISCARD/ : {
  9. *(.discard)
  10. *(.discard.*)
  11. /*
  12. * LLD may emit .eh_frame with CONFIG_CFI_CLANG despite
  13. * -fno-asynchronous-unwind-tables. Discard the section.
  14. */
  15. *(.eh_frame)
  16. }
  17. __ksymtab 0 : { *(SORT(___ksymtab+*)) }
  18. __ksymtab_gpl 0 : { *(SORT(___ksymtab_gpl+*)) }
  19. __ksymtab_unused 0 : { *(SORT(___ksymtab_unused+*)) }
  20. __ksymtab_unused_gpl 0 : { *(SORT(___ksymtab_unused_gpl+*)) }
  21. __ksymtab_gpl_future 0 : { *(SORT(___ksymtab_gpl_future+*)) }
  22. __kcrctab 0 : { *(SORT(___kcrctab+*)) }
  23. __kcrctab_gpl 0 : { *(SORT(___kcrctab_gpl+*)) }
  24. __kcrctab_unused 0 : { *(SORT(___kcrctab_unused+*)) }
  25. __kcrctab_unused_gpl 0 : { *(SORT(___kcrctab_unused_gpl+*)) }
  26. __kcrctab_gpl_future 0 : { *(SORT(___kcrctab_gpl_future+*)) }
  27. .init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) }
  28. __jump_table 0 : ALIGN(8) { KEEP(*(__jump_table)) }
  29. __patchable_function_entries : { *(__patchable_function_entries) }
  30. /*
  31. * With CONFIG_LTO_CLANG, LLD always enables -fdata-sections and
  32. * -ffunction-sections, which increases the size of the final module.
  33. * Merge the split sections in the final binary.
  34. */
  35. .bss : {
  36. *(.bss .bss.[0-9a-zA-Z_]*)
  37. *(.bss..L*)
  38. }
  39. .data : {
  40. *(.data .data.[0-9a-zA-Z_]*)
  41. *(.data..L*)
  42. }
  43. .rodata : {
  44. *(.rodata .rodata.[0-9a-zA-Z_]*)
  45. *(.rodata..L*)
  46. }
  47. #ifdef CONFIG_CFI_CLANG
  48. /*
  49. * With CFI_CLANG, ensure __cfi_check is at the beginning of the
  50. * .text section, and that the section is aligned to page size.
  51. */
  52. .text : ALIGN(PAGE_SIZE) {
  53. *(.text.__cfi_check)
  54. *(.text .text.[0-9a-zA-Z_]*)
  55. __cfi_jt_start = .;
  56. *(.text..L.cfi.jumptable .text..L.cfi.jumptable.*)
  57. __cfi_jt_end = .;
  58. }
  59. #endif
  60. }
  61. /* bring in arch-specific sections */
  62. #include <asm/module.lds.h>