fw_base.ldS 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * SPDX-License-Identifier: BSD-2-Clause
  3. *
  4. * Copyright (c) 2019 Western Digital Corporation or its affiliates.
  5. *
  6. * Authors:
  7. * Anup Patel <anup.patel@wdc.com>
  8. */
  9. . = FW_TEXT_START;
  10. /* Don't add any section between FW_TEXT_START and _fw_start */
  11. PROVIDE(_fw_start = .);
  12. . = ALIGN(0x1000); /* Need this to create proper sections */
  13. /* Beginning of the code section */
  14. .text :
  15. {
  16. PROVIDE(_text_start = .);
  17. *(.entry)
  18. *(.text)
  19. . = ALIGN(8);
  20. PROVIDE(_text_end = .);
  21. }
  22. /* End of the code sections */
  23. . = ALIGN(0x1000); /* Ensure next section is page aligned */
  24. /* Beginning of the read-only data sections */
  25. PROVIDE(_rodata_start = .);
  26. .rodata :
  27. {
  28. *(.rodata .rodata.*)
  29. . = ALIGN(8);
  30. }
  31. . = ALIGN(0x1000); /* Ensure next section is page aligned */
  32. .dynsym : {
  33. PROVIDE(__dyn_sym_start = .);
  34. *(.dynsym)
  35. PROVIDE(__dyn_sym_end = .);
  36. }
  37. .rela.dyn : {
  38. PROVIDE(__rel_dyn_start = .);
  39. *(.rela*)
  40. . = ALIGN(8);
  41. PROVIDE(__rel_dyn_end = .);
  42. }
  43. PROVIDE(_rodata_end = .);
  44. /* End of the read-only data sections */
  45. /*
  46. * PMP regions must be to be power-of-2. RX/RW will have separate
  47. * regions, so ensure that the split is power-of-2.
  48. */
  49. . = ALIGN(1 << LOG2CEIL((SIZEOF(.rodata) + SIZEOF(.text)
  50. + SIZEOF(.dynsym) + SIZEOF(.rela.dyn))));
  51. PROVIDE(_fw_rw_start = .);
  52. /* Beginning of the read-write data sections */
  53. .data :
  54. {
  55. PROVIDE(_data_start = .);
  56. *(.sdata)
  57. *(.sdata.*)
  58. *(.data)
  59. *(.data.*)
  60. *(.readmostly.data)
  61. *(*.data)
  62. . = ALIGN(8);
  63. PROVIDE(_data_end = .);
  64. }
  65. . = ALIGN(0x1000); /* Ensure next section is page aligned */
  66. .bss :
  67. {
  68. PROVIDE(_bss_start = .);
  69. *(.sbss)
  70. *(.sbss.*)
  71. *(.bss)
  72. *(.bss.*)
  73. . = ALIGN(8);
  74. PROVIDE(_bss_end = .);
  75. }
  76. /* End of the read-write data sections */
  77. . = ALIGN(0x1000); /* Need this to create proper sections */
  78. PROVIDE(_fw_end = .);