vmlinux.lds.S 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * OpenRISC vmlinux.lds.S
  4. *
  5. * Linux architectural port borrowing liberally from similar works of
  6. * others. All original copyrights apply as per the original source
  7. * declaration.
  8. *
  9. * Modifications for the OpenRISC architecture:
  10. * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
  11. * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
  12. *
  13. * ld script for OpenRISC architecture
  14. */
  15. /* TODO
  16. * - clean up __offset & stuff
  17. * - change all 8192 alignment to PAGE !!!
  18. * - recheck if all alignments are really needed
  19. */
  20. # define LOAD_OFFSET PAGE_OFFSET
  21. # define LOAD_BASE PAGE_OFFSET
  22. #include <asm/page.h>
  23. #include <asm/cache.h>
  24. #include <asm/thread_info.h>
  25. #include <asm-generic/vmlinux.lds.h>
  26. #ifdef __OR1K__
  27. #define __OUTPUT_FORMAT "elf32-or1k"
  28. #else
  29. #define __OUTPUT_FORMAT "elf32-or32"
  30. #endif
  31. OUTPUT_FORMAT(__OUTPUT_FORMAT, __OUTPUT_FORMAT, __OUTPUT_FORMAT)
  32. jiffies = jiffies_64 + 4;
  33. SECTIONS
  34. {
  35. /* Read-only sections, merged into text segment: */
  36. . = LOAD_BASE ;
  37. _text = .;
  38. /* _s_kernel_ro must be page aligned */
  39. . = ALIGN(PAGE_SIZE);
  40. _s_kernel_ro = .;
  41. .text : AT(ADDR(.text) - LOAD_OFFSET)
  42. {
  43. _stext = .;
  44. TEXT_TEXT
  45. SCHED_TEXT
  46. CPUIDLE_TEXT
  47. LOCK_TEXT
  48. KPROBES_TEXT
  49. IRQENTRY_TEXT
  50. SOFTIRQENTRY_TEXT
  51. *(.fixup)
  52. *(.text.__*)
  53. _etext = .;
  54. }
  55. /* TODO: Check if fixup and text.__* are really necessary
  56. * fixup is definitely necessary
  57. */
  58. _sdata = .;
  59. /* Page alignment required for RO_DATA */
  60. RO_DATA(PAGE_SIZE)
  61. _e_kernel_ro = .;
  62. /* Whatever comes after _e_kernel_ro had better be page-aligend, too */
  63. /* 32 here is cacheline size... recheck this */
  64. RW_DATA(32, PAGE_SIZE, PAGE_SIZE)
  65. _edata = .;
  66. EXCEPTION_TABLE(4)
  67. /* Init code and data */
  68. . = ALIGN(PAGE_SIZE);
  69. __init_begin = .;
  70. HEAD_TEXT_SECTION
  71. /* Page aligned */
  72. INIT_TEXT_SECTION(PAGE_SIZE)
  73. /* Align __setup_start on 16 byte boundary */
  74. INIT_DATA_SECTION(16)
  75. PERCPU_SECTION(L1_CACHE_BYTES)
  76. __init_end = .;
  77. BSS_SECTION(0, 0, 0x20)
  78. _end = .;
  79. /* Throw in the debugging sections */
  80. STABS_DEBUG
  81. DWARF_DEBUG
  82. ELF_DETAILS
  83. /* Sections to be discarded -- must be last */
  84. DISCARDS
  85. }