vmlinux.lds.S 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * ld script to make SuperH Linux kernel
  4. * Written by Niibe Yutaka and Paul Mundt
  5. */
  6. #ifdef CONFIG_SUPERH64
  7. #define LOAD_OFFSET PAGE_OFFSET
  8. OUTPUT_ARCH(sh:sh5)
  9. #else
  10. #define LOAD_OFFSET 0
  11. OUTPUT_ARCH(sh)
  12. #endif
  13. #include <asm/thread_info.h>
  14. #include <asm/cache.h>
  15. #include <asm/vmlinux.lds.h>
  16. #ifdef CONFIG_PMB
  17. #define MEMORY_OFFSET 0
  18. #else
  19. #define MEMORY_OFFSET __MEMORY_START
  20. #endif
  21. ENTRY(_start)
  22. SECTIONS
  23. {
  24. . = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
  25. _text = .; /* Text and read-only data */
  26. .empty_zero_page : AT(ADDR(.empty_zero_page) - LOAD_OFFSET) {
  27. *(.empty_zero_page)
  28. } = 0
  29. .text : AT(ADDR(.text) - LOAD_OFFSET) {
  30. HEAD_TEXT
  31. TEXT_TEXT
  32. EXTRA_TEXT
  33. SCHED_TEXT
  34. CPUIDLE_TEXT
  35. LOCK_TEXT
  36. KPROBES_TEXT
  37. IRQENTRY_TEXT
  38. SOFTIRQENTRY_TEXT
  39. *(.fixup)
  40. *(.gnu.warning)
  41. _etext = .; /* End of text section */
  42. } = 0x0009
  43. EXCEPTION_TABLE(16)
  44. NOTES
  45. _sdata = .;
  46. RO_DATA(PAGE_SIZE)
  47. RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
  48. _edata = .;
  49. DWARF_EH_FRAME
  50. . = ALIGN(PAGE_SIZE); /* Init code and data */
  51. __init_begin = .;
  52. INIT_TEXT_SECTION(PAGE_SIZE)
  53. INIT_DATA_SECTION(16)
  54. . = ALIGN(4);
  55. .machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) {
  56. __machvec_start = .;
  57. *(.machvec.init)
  58. __machvec_end = .;
  59. }
  60. PERCPU_SECTION(L1_CACHE_BYTES)
  61. /*
  62. * .exit.text is discarded at runtime, not link time, to deal with
  63. * references from __bug_table
  64. */
  65. .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { EXIT_TEXT }
  66. .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { EXIT_DATA }
  67. . = ALIGN(PAGE_SIZE);
  68. __init_end = .;
  69. BSS_SECTION(0, PAGE_SIZE, 4)
  70. _end = . ;
  71. STABS_DEBUG
  72. DWARF_DEBUG
  73. DISCARDS
  74. }