test.elf.ldS 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. OUTPUT_ARCH(riscv)
  10. ENTRY(_start)
  11. SECTIONS
  12. {
  13. #ifdef FW_PAYLOAD_OFFSET
  14. . = FW_TEXT_START + FW_PAYLOAD_OFFSET;
  15. #else
  16. . = ALIGN(FW_PAYLOAD_ALIGN);
  17. #endif
  18. PROVIDE(_payload_start = .);
  19. . = ALIGN(0x1000); /* Need this to create proper sections */
  20. /* Beginning of the code section */
  21. .text :
  22. {
  23. PROVIDE(_text_start = .);
  24. *(.entry)
  25. *(.text)
  26. . = ALIGN(8);
  27. PROVIDE(_text_end = .);
  28. }
  29. . = ALIGN(0x1000); /* Ensure next section is page aligned */
  30. /* End of the code sections */
  31. /* Beginning of the read-only data sections */
  32. . = ALIGN(0x1000); /* Ensure next section is page aligned */
  33. .rodata :
  34. {
  35. PROVIDE(_rodata_start = .);
  36. *(.rodata .rodata.*)
  37. . = ALIGN(8);
  38. PROVIDE(_rodata_end = .);
  39. }
  40. /* End of the read-only data sections */
  41. /* Beginning of the read-write data sections */
  42. . = ALIGN(0x1000); /* Ensure next section is page aligned */
  43. .data :
  44. {
  45. PROVIDE(_data_start = .);
  46. *(.data)
  47. *(.data.*)
  48. *(.readmostly.data)
  49. *(*.data)
  50. . = ALIGN(8);
  51. PROVIDE(_data_end = .);
  52. }
  53. . = ALIGN(0x1000); /* Ensure next section is page aligned */
  54. .bss :
  55. {
  56. PROVIDE(_bss_start = .);
  57. *(.bss)
  58. *(.bss.*)
  59. . = ALIGN(8);
  60. PROVIDE(_bss_end = .);
  61. }
  62. /* End of the read-write data sections */
  63. . = ALIGN(0x1000); /* Need this to create proper sections */
  64. PROVIDE(_payload_end = .);
  65. }