vmlinux.lds.S 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * Copyright (C) 2012 Regents of the University of California
  3. * Copyright (C) 2017 SiFive
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation, version 2.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #define LOAD_OFFSET PAGE_OFFSET
  15. #include <asm/vmlinux.lds.h>
  16. #include <asm/page.h>
  17. #include <asm/cache.h>
  18. #include <asm/thread_info.h>
  19. OUTPUT_ARCH(riscv)
  20. ENTRY(_start)
  21. jiffies = jiffies_64;
  22. SECTIONS
  23. {
  24. /* Beginning of code and text segment */
  25. . = LOAD_OFFSET;
  26. _start = .;
  27. __init_begin = .;
  28. HEAD_TEXT_SECTION
  29. INIT_TEXT_SECTION(PAGE_SIZE)
  30. INIT_DATA_SECTION(16)
  31. /* we have to discard exit text and such at runtime, not link time */
  32. .exit.text :
  33. {
  34. EXIT_TEXT
  35. }
  36. .exit.data :
  37. {
  38. EXIT_DATA
  39. }
  40. PERCPU_SECTION(L1_CACHE_BYTES)
  41. __init_end = .;
  42. .text : {
  43. _text = .;
  44. _stext = .;
  45. TEXT_TEXT
  46. SCHED_TEXT
  47. CPUIDLE_TEXT
  48. LOCK_TEXT
  49. KPROBES_TEXT
  50. ENTRY_TEXT
  51. IRQENTRY_TEXT
  52. *(.fixup)
  53. _etext = .;
  54. }
  55. /* Start of data section */
  56. _sdata = .;
  57. RO_DATA_SECTION(L1_CACHE_BYTES)
  58. .srodata : {
  59. *(.srodata*)
  60. }
  61. RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
  62. .sdata : {
  63. __global_pointer$ = . + 0x800;
  64. *(.sdata*)
  65. /* End of data section */
  66. _edata = .;
  67. *(.sbss*)
  68. }
  69. BSS_SECTION(0, 0, 0)
  70. EXCEPTION_TABLE(0x10)
  71. NOTES
  72. .rel.dyn : {
  73. *(.rel.dyn*)
  74. }
  75. _end = .;
  76. STABS_DEBUG
  77. DWARF_DEBUG
  78. DISCARDS
  79. }