vmlinux.lds.S 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * ld script to make compressed SuperH/shmedia Linux kernel+decompression
  3. * bootstrap
  4. * Modified by Stuart Menefy from arch/sh/vmlinux.lds.S written by Niibe Yutaka
  5. */
  6. #include <linux/config.h>
  7. #ifdef CONFIG_LITTLE_ENDIAN
  8. /* OUTPUT_FORMAT("elf32-sh64l-linux", "elf32-sh64l-linux", "elf32-sh64l-linux") */
  9. #define NOP 0x6ff0fff0
  10. #else
  11. /* OUTPUT_FORMAT("elf32-sh64", "elf32-sh64", "elf32-sh64") */
  12. #define NOP 0xf0fff06f
  13. #endif
  14. OUTPUT_FORMAT("elf32-sh64-linux")
  15. OUTPUT_ARCH(sh)
  16. ENTRY(_start)
  17. #define ALIGNED_GAP(section, align) (((ADDR(section)+SIZEOF(section)+(align)-1) & ~((align)-1))-ADDR(section))
  18. #define FOLLOWING(section, align) AT (LOADADDR(section) + ALIGNED_GAP(section,align))
  19. SECTIONS
  20. {
  21. _text = .; /* Text and read-only data */
  22. .text : {
  23. *(.text)
  24. *(.text64)
  25. *(.text..SHmedia32)
  26. *(.fixup)
  27. *(.gnu.warning)
  28. } = NOP
  29. . = ALIGN(4);
  30. .rodata : { *(.rodata) }
  31. /* There is no 'real' reason for eight byte alignment, four would work
  32. * as well, but gdb downloads much (*4) faster with this.
  33. */
  34. . = ALIGN(8);
  35. .image : { *(.image) }
  36. . = ALIGN(4);
  37. _etext = .; /* End of text section */
  38. .data : /* Data */
  39. FOLLOWING(.image, 4)
  40. {
  41. _data = .;
  42. *(.data)
  43. }
  44. _data_image = LOADADDR(.data);/* Address of data section in ROM */
  45. _edata = .; /* End of data section */
  46. .stack : { stack = .; _stack = .; }
  47. . = ALIGN(4);
  48. __bss_start = .; /* BSS */
  49. .bss : {
  50. *(.bss)
  51. }
  52. . = ALIGN(4);
  53. _end = . ;
  54. }