vmlinux.lds.S 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. OUTPUT_FORMAT("elf32-or32", "elf32-or32", "elf32-or32")
  30. jiffies = jiffies_64 + 4;
  31. SECTIONS
  32. {
  33. /* Read-only sections, merged into text segment: */
  34. . = LOAD_BASE ;
  35. _text = .;
  36. /* _s_kernel_ro must be page aligned */
  37. . = ALIGN(PAGE_SIZE);
  38. _s_kernel_ro = .;
  39. .text : AT(ADDR(.text) - LOAD_OFFSET)
  40. {
  41. _stext = .;
  42. TEXT_TEXT
  43. SCHED_TEXT
  44. CPUIDLE_TEXT
  45. LOCK_TEXT
  46. KPROBES_TEXT
  47. IRQENTRY_TEXT
  48. SOFTIRQENTRY_TEXT
  49. *(.fixup)
  50. *(.text.__*)
  51. _etext = .;
  52. }
  53. /* TODO: Check if fixup and text.__* are really necessary
  54. * fixup is definitely necessary
  55. */
  56. _sdata = .;
  57. /* Page alignment required for RO_DATA_SECTION */
  58. RO_DATA_SECTION(PAGE_SIZE)
  59. _e_kernel_ro = .;
  60. /* Whatever comes after _e_kernel_ro had better be page-aligend, too */
  61. /* 32 here is cacheline size... recheck this */
  62. RW_DATA_SECTION(32, PAGE_SIZE, PAGE_SIZE)
  63. _edata = .;
  64. EXCEPTION_TABLE(4)
  65. NOTES
  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. . = ALIGN(PAGE_SIZE);
  77. .initrd : AT(ADDR(.initrd) - LOAD_OFFSET)
  78. {
  79. __initrd_start = .;
  80. *(.initrd)
  81. __initrd_end = .;
  82. FILL (0);
  83. . = ALIGN (PAGE_SIZE);
  84. }
  85. __vmlinux_end = .; /* last address of the physical file */
  86. BSS_SECTION(0, 0, 0x20)
  87. _end = .;
  88. /* Throw in the debugging sections */
  89. STABS_DEBUG
  90. DWARF_DEBUG
  91. /* Sections to be discarded -- must be last */
  92. DISCARDS
  93. }