linker_fips.ld 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. MEMORY
  2. {
  3. FLASH (wx) : ORIGIN = 0x00000000, LENGTH = 256K
  4. RAM (wx) : ORIGIN = 0x20000000, LENGTH = 64K
  5. }
  6. SECTIONS
  7. {
  8. __vectors_start__ = .;
  9. .vectors : { *(.vectors) } > FLASH
  10. __vectors_end__ = __vectors_start__ + 0x400;
  11. /* Custom section for wolfCrypt FIPS module */
  12. .wolfCryptFIPSModule_text :
  13. {
  14. . = ALIGN(4);
  15. KEEP(wolfcrypt_first.o (.text .text* ))
  16. KEEP(aes.o(.text .text* ))
  17. KEEP(cmac.o (.text .text* ))
  18. KEEP(des3.o (.text .text* ))
  19. KEEP(dh.o (.text .text* ))
  20. KEEP(ecc.o (.text .text* ))
  21. KEEP(fips.o (.text .text* ))
  22. KEEP(fips_test.o (.text .text* ))
  23. KEEP(hmac.o (.text .text* ))
  24. KEEP(random.o(.text .text* ))
  25. KEEP(rsa.o (.text .text* ))
  26. KEEP(sha.o (.text .text* ))
  27. KEEP(sha256.o (.text .text* ))
  28. KEEP(sha3.o (.text .text* ))
  29. KEEP(sha512.o (.text .text* ))
  30. KEEP(wolfcrypt_last.o(.text .text*))
  31. . = ALIGN(4);
  32. } > FLASH
  33. .wolfCryptFIPSModule_rodata :
  34. {
  35. . = ALIGN(4);
  36. KEEP(wolfcrypt_first.o (.rodata .rodata*))
  37. KEEP(aes.o(.rodata .rodata*))
  38. KEEP(cmac.o(.rodata .rodata*))
  39. KEEP(des3.o(.rodata .rodata*))
  40. KEEP(dh.o(.rodata .rodata*))
  41. KEEP(ecc.o(.rodata .rodata*))
  42. KEEP(fips.o(.rodata .rodata*))
  43. KEEP(fips_test.o(.rodata .rodata*))
  44. KEEP(hmac.o(.rodata .rodata*))
  45. KEEP(random.o(.rodata .rodata*))
  46. KEEP(rsa.o(.rodata .rodata*))
  47. KEEP(sha.o(.rodata .rodata*))
  48. KEEP(sha256.o(.rodata .rodata*))
  49. KEEP(sha3.o(.rodata .rodata*))
  50. KEEP(sha512.o(.rodata .rodata*))
  51. KEEP(wolfcrypt_last.o(.rodata .rodata*))
  52. . = ALIGN(4);
  53. } > FLASH
  54. /* Custom section for wolfCrypt and LibC to prevent FIPS hash from changing
  55. when application code changes are made */
  56. .wolfCryptNonFIPS_text :
  57. {
  58. . = ALIGN(4);
  59. lib_a* ( .text .text*)
  60. *wolf*src*.o(.text .text*)
  61. . = ALIGN(4);
  62. } > FLASH
  63. .wolfCryptNonFIPS_rodata :
  64. {
  65. . = ALIGN(4);
  66. lib_a* (.rodata .rodata*)
  67. *wolf*src*.o(.rodata .rodata*)
  68. . = ALIGN(4);
  69. } > FLASH
  70. .sys : { *(.sys*) } > FLASH
  71. .text : { *(.text*) } > FLASH
  72. .rodata : { *(.text*) } > FLASH
  73. __data_load_start__ = .;
  74. __data_start__ = .;
  75. .data : { *(.data*) } > RAM
  76. __data_end__ = __data_start__ + SIZEOF(.data);
  77. __bss_start__ = .;
  78. .bss : { *(.bss*) } > RAM
  79. __bss_end__ = __bss_start__ + SIZEOF(.bss);
  80. __heap_start__ = .;
  81. .heap : { *(.heap*) } > RAM
  82. __heap_end__ = __heap_start__ + SIZEOF(.heap);
  83. end = .;
  84. }