vmlinux.lds.S 2.7 KB

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