vmlinux.lds.S 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * Copyright (C) 2000 Russell King
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifdef CONFIG_CPU_ENDIAN_BE8
  9. #define ZIMAGE_MAGIC(x) ( (((x) >> 24) & 0x000000ff) | \
  10. (((x) >> 8) & 0x0000ff00) | \
  11. (((x) << 8) & 0x00ff0000) | \
  12. (((x) << 24) & 0xff000000) )
  13. #else
  14. #define ZIMAGE_MAGIC(x) (x)
  15. #endif
  16. OUTPUT_ARCH(arm)
  17. ENTRY(_start)
  18. SECTIONS
  19. {
  20. /DISCARD/ : {
  21. *(.ARM.exidx*)
  22. *(.ARM.extab*)
  23. /*
  24. * Discard any r/w data - this produces a link error if we have any,
  25. * which is required for PIC decompression. Local data generates
  26. * GOTOFF relocations, which prevents it being relocated independently
  27. * of the text/got segments.
  28. */
  29. *(.data)
  30. }
  31. . = TEXT_START;
  32. _text = .;
  33. .text : {
  34. _start = .;
  35. *(.start)
  36. *(.text)
  37. *(.text.*)
  38. *(.fixup)
  39. *(.gnu.warning)
  40. *(.glue_7t)
  41. *(.glue_7)
  42. }
  43. .rodata : {
  44. *(.rodata)
  45. *(.rodata.*)
  46. }
  47. .data : {
  48. /*
  49. * The EFI stub always executes from RAM, and runs strictly before the
  50. * decompressor, so we can make an exception for its r/w data, and keep it
  51. */
  52. *(.data.efistub)
  53. }
  54. .piggydata : {
  55. *(.piggydata)
  56. }
  57. . = ALIGN(4);
  58. _etext = .;
  59. .got.plt : { *(.got.plt) }
  60. _got_start = .;
  61. .got : { *(.got) }
  62. _got_end = .;
  63. /* ensure the zImage file size is always a multiple of 64 bits */
  64. /* (without a dummy byte, ld just ignores the empty section) */
  65. .pad : { BYTE(0); . = ALIGN(8); }
  66. _edata = .;
  67. _magic_sig = ZIMAGE_MAGIC(0x016f2818);
  68. _magic_start = ZIMAGE_MAGIC(_start);
  69. _magic_end = ZIMAGE_MAGIC(_edata);
  70. . = BSS_START;
  71. __bss_start = .;
  72. .bss : { *(.bss) }
  73. _end = .;
  74. . = ALIGN(8); /* the stack must be 64-bit aligned */
  75. .stack : { *(.stack) }
  76. .stab 0 : { *(.stab) }
  77. .stabstr 0 : { *(.stabstr) }
  78. .stab.excl 0 : { *(.stab.excl) }
  79. .stab.exclstr 0 : { *(.stab.exclstr) }
  80. .stab.index 0 : { *(.stab.index) }
  81. .stab.indexstr 0 : { *(.stab.indexstr) }
  82. .comment 0 : { *(.comment) }
  83. }