trustzone-system-onesegment.ld 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
  2. OUTPUT_ARCH(arm)
  3. ENTRY(_start)
  4. SECTIONS
  5. {
  6. /*Added TRUSTZONE at 0x0. Moving rest of APPSBL to %MEMBASE% */
  7. . = 0x0;
  8. .tzbsp 0x0 : {*tzbsp_bin.o(.data)}
  9. . = %MEMBASE%;
  10. .interp : { *(.interp) }
  11. .hash : { *(.hash) }
  12. .dynsym : { *(.dynsym) }
  13. .dynstr : { *(.dynstr) }
  14. .rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
  15. .rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
  16. .rel.data : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
  17. .rela.data : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
  18. .rel.rodata : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
  19. .rela.rodata : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
  20. .rel.got : { *(.rel.got) }
  21. .rela.got : { *(.rela.got) }
  22. .rel.ctors : { *(.rel.ctors) }
  23. .rela.ctors : { *(.rela.ctors) }
  24. .rel.dtors : { *(.rel.dtors) }
  25. .rela.dtors : { *(.rela.dtors) }
  26. .rel.init : { *(.rel.init) }
  27. .rela.init : { *(.rela.init) }
  28. .rel.fini : { *(.rel.fini) }
  29. .rela.fini : { *(.rela.fini) }
  30. .rel.bss : { *(.rel.bss) }
  31. .rela.bss : { *(.rela.bss) }
  32. .rel.plt : { *(.rel.plt) }
  33. .rela.plt : { *(.rela.plt) }
  34. /*Moving harcoded addresses by a displacement of %MEMBASE% */
  35. .init : { *(.init) } = %MEMBASE% + 0x9090
  36. .plt : { *(.plt) }
  37. /* text/read-only data */
  38. /*Moving harcoded addresses by a displacement of %MEMBASE% */
  39. .text : { *(.text .text.* .glue_7* .gnu.linkonce.t.*) } = %MEMBASE% + 0x9090
  40. .rodata : {
  41. *(.rodata .rodata.* .gnu.linkonce.r.*)
  42. . = ALIGN(4);
  43. __commands_start = .;
  44. KEEP (*(.commands))
  45. __commands_end = .;
  46. . = ALIGN(4);
  47. __apps_start = .;
  48. KEEP (*(.apps))
  49. __apps_end = .;
  50. . = ALIGN(4);
  51. __rodata_end = . ;
  52. }
  53. /* writable data */
  54. __data_start_rom = .; /* in one segment binaries, the rom data address is on top of the ram data address */
  55. __data_start = .;
  56. .data : SUBALIGN(4) { *(.data .data.* .gnu.linkonce.d.*) }
  57. __ctor_list = .;
  58. .ctors : { *(.ctors) }
  59. __ctor_end = .;
  60. __dtor_list = .;
  61. .dtors : { *(.dtors) }
  62. __dtor_end = .;
  63. .got : { *(.got.plt) *(.got) }
  64. .dynamic : { *(.dynamic) }
  65. __data_end = .;
  66. /* unintialized data (in same segment as writable data) */
  67. . = ALIGN(4);
  68. __bss_start = .;
  69. .bss : { *(.bss .bss.*) }
  70. . = ALIGN(4);
  71. _end = .;
  72. . = %MEMBASE% + %MEMSIZE%;
  73. _end_of_ram = .;
  74. /* Strip unnecessary stuff */
  75. /DISCARD/ : { *(.comment .note .eh_frame) }
  76. }