module.lds.S 2.1 KB

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