vmlinux.lds.S 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. LOCK_TEXT
  47. KPROBES_TEXT
  48. IRQENTRY_TEXT
  49. SOFTIRQENTRY_TEXT
  50. *(.fixup)
  51. *(.text.__*)
  52. _etext = .;
  53. }
  54. /* TODO: Check if fixup and text.__* are really necessary
  55. * fixup is definitely necessary
  56. */
  57. _sdata = .;
  58. /* Page alignment required for RO_DATA */
  59. RO_DATA(PAGE_SIZE)
  60. _e_kernel_ro = .;
  61. /* Whatever comes after _e_kernel_ro had better be page-aligend, too */
  62. /* 32 here is cacheline size... recheck this */
  63. RW_DATA(32, PAGE_SIZE, PAGE_SIZE)
  64. _edata = .;
  65. EXCEPTION_TABLE(4)
  66. /* Init code and data */
  67. . = ALIGN(PAGE_SIZE);
  68. __init_begin = .;
  69. HEAD_TEXT_SECTION
  70. /* Page aligned */
  71. INIT_TEXT_SECTION(PAGE_SIZE)
  72. /* Align __setup_start on 16 byte boundary */
  73. INIT_DATA_SECTION(16)
  74. PERCPU_SECTION(L1_CACHE_BYTES)
  75. __init_end = .;
  76. BSS_SECTION(0, 0, 0x20)
  77. _end = .;
  78. /* Throw in the debugging sections */
  79. STABS_DEBUG
  80. DWARF_DEBUG
  81. ELF_DETAILS
  82. /* Sections to be discarded -- must be last */
  83. DISCARDS
  84. }