module.lds.S 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #ifdef CONFIG_LTO_CLANG
  31. /*
  32. * With CONFIG_LTO_CLANG, LLD always enables -fdata-sections and
  33. * -ffunction-sections, which increases the size of the final module.
  34. * Merge the split sections in the final binary.
  35. */
  36. .bss : {
  37. *(.bss .bss.[0-9a-zA-Z_]*)
  38. *(.bss..L*)
  39. }
  40. .data : {
  41. *(.data .data.[0-9a-zA-Z_]*)
  42. *(.data..L*)
  43. }
  44. .rodata : {
  45. *(.rodata.._start)
  46. *(.rodata .rodata.[0-9a-zA-Z_]*)
  47. *(.rodata..L*)
  48. *(.rodata.._end)
  49. }
  50. .text : ALIGN(PAGE_SIZE) {
  51. *(.text.._start)
  52. #ifdef CONFIG_CFI_CLANG
  53. /*
  54. * With CFI_CLANG, ensure __cfi_check is at the beginning of
  55. * the .text section, and that the section is aligned to page
  56. * size.
  57. */
  58. *(.text.__cfi_check)
  59. #endif
  60. *(.text .text.[0-9a-zA-Z_]*)
  61. __cfi_jt_start = .;
  62. *(.text..L.cfi.jumptable .text..L.cfi.jumptable.*)
  63. __cfi_jt_end = .;
  64. *(.text.._end)
  65. *(.text.._fips140_unchecked)
  66. }
  67. #endif
  68. }
  69. /* bring in arch-specific sections */
  70. #include <asm/module.lds.h>