vmlinux_64.lds 1.4 KB

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