module.lds.S 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. #ifdef CONFIG_UNWIND_TABLES
  7. #define DISCARD_EH_FRAME
  8. #else
  9. #define DISCARD_EH_FRAME *(.eh_frame)
  10. #endif
  11. #include <asm-generic/codetag.lds.h>
  12. SECTIONS {
  13. /DISCARD/ : {
  14. *(.discard)
  15. *(.discard.*)
  16. *(.export_symbol)
  17. *(.no_trim_symbol)
  18. }
  19. __ksymtab 0 : ALIGN(8) { *(SORT(___ksymtab+*)) }
  20. __ksymtab_gpl 0 : ALIGN(8) { *(SORT(___ksymtab_gpl+*)) }
  21. __kcrctab 0 : ALIGN(4) { *(SORT(___kcrctab+*)) }
  22. __kcrctab_gpl 0 : ALIGN(4) { *(SORT(___kcrctab_gpl+*)) }
  23. .ctors 0 : ALIGN(8) { *(SORT(.ctors.*)) *(.ctors) }
  24. .init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) }
  25. .altinstructions 0 : ALIGN(8) { KEEP(*(.altinstructions)) }
  26. __bug_table 0 : ALIGN(8) { KEEP(*(__bug_table)) }
  27. __jump_table 0 : ALIGN(8) { KEEP(*(__jump_table)) }
  28. __ex_table 0 : ALIGN(4) { KEEP(*(__ex_table)) }
  29. __patchable_function_entries : { *(__patchable_function_entries) }
  30. .init.klp_funcs 0 : ALIGN(8) { KEEP(*(.init.klp_funcs)) }
  31. .init.klp_objects 0 : ALIGN(8) { KEEP(*(.init.klp_objects)) }
  32. #ifdef CONFIG_ARCH_USES_CFI_TRAPS
  33. __kcfi_traps : { KEEP(*(.kcfi_traps)) }
  34. #endif
  35. .text : {
  36. *(.text .text.[0-9a-zA-Z_]*)
  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 .rodata.[0-9a-zA-Z_]*)
  48. *(.rodata..L*)
  49. }
  50. MOD_SEPARATE_CODETAG_SECTIONS()
  51. }
  52. /* bring in arch-specific sections */
  53. #include <asm/module.lds.h>