test.elf.ldS 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. /* End of the code sections */
  30. . = ALIGN(0x1000); /* Ensure next section is page aligned */
  31. /* Beginning of the read-only data sections */
  32. .rodata :
  33. {
  34. PROVIDE(_rodata_start = .);
  35. *(.rodata .rodata.*)
  36. . = ALIGN(8);
  37. PROVIDE(_rodata_end = .);
  38. }
  39. /* End of the read-only data sections */
  40. . = ALIGN(0x1000); /* Ensure next section is page aligned */
  41. /* Beginning of the read-write data sections */
  42. .data :
  43. {
  44. PROVIDE(_data_start = .);
  45. *(.data)
  46. *(.data.*)
  47. *(.readmostly.data)
  48. *(*.data)
  49. . = ALIGN(8);
  50. PROVIDE(_data_end = .);
  51. }
  52. . = ALIGN(0x1000); /* Ensure next section is page aligned */
  53. .bss :
  54. {
  55. PROVIDE(_bss_start = .);
  56. *(.bss)
  57. *(.bss.*)
  58. . = ALIGN(8);
  59. PROVIDE(_bss_end = .);
  60. }
  61. /* End of the read-write data sections */
  62. . = ALIGN(0x1000); /* Need this to create proper sections */
  63. PROVIDE(_payload_end = .);
  64. }