trustzone-test-system-onesegment.ld 2.4 KB

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