enclave.lds 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
  2. OUTPUT_ARCH(i386:x86-64)
  3. PHDRS
  4. {
  5. headers PT_PHDR PHDRS;
  6. text PT_LOAD FILEHDR PHDRS;
  7. data PT_LOAD;
  8. dynamic PT_DYNAMIC;
  9. tls PT_TLS;
  10. gnu_stack PT_GNU_STACK;
  11. }
  12. SECTIONS
  13. {
  14. /* Read-only sections, merged into text segment; */
  15. pal_start_addr = .;
  16. __text_start = .;
  17. . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
  18. text_start = .;
  19. .note.gnu.build-id : { *(.note.gnu.build-id) } :text
  20. .gnu.hash : { *(.gnu.hash) } :text
  21. .dynsym : { *(.dynsym) } :text
  22. .dynstr : { *(.dynstr) } :text
  23. .gnu.version : { *(.gnu.version) } :text
  24. .gnu.version_d : { *(.gnu.version_d) } :text
  25. .rela.dyn : { *(.rela.dyn) } :text
  26. .rela.plt : { *(.rela.plt) } :text
  27. .init : { *(.init) } :text
  28. .plt : { *(.plt) *(.iplt) } :text
  29. .text :
  30. {
  31. section_text = .;
  32. /* the rest of text segments */
  33. *(.text .stub .text.*);
  34. } :text
  35. .fini : { *(.fini) } :text
  36. .eh_frame_hdr : { *(.eh_frame_hdr) } :text
  37. .eh_frame : ONLY_IF_RO { KEEP(*(.eh_frame)) } :text
  38. .rodata :
  39. {
  40. section_rodata = .;
  41. /* the rest of rodata */
  42. *(.rodata .rodata.*)
  43. } :text
  44. __text_end = .;
  45. /* now adjust the address for the data segment */
  46. . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  47. __data_start = .;
  48. .tdata :
  49. {
  50. *(.tdata)
  51. } :tls
  52. .dynamic :
  53. {
  54. section_dynamic = .;
  55. *(.dynamic)
  56. } :data :dynamic
  57. data_start = .;
  58. .data.rel.ro : { KEEP(*(.data.rel.ro)) } :data
  59. .ctors : { KEEP(*(.ctors)) } :data
  60. .dtors : { KEEP(*(.dtors)) } :data
  61. .jcr : { KEEP(*(.jcr)) } :data
  62. .got : { *(.got) *(.igot) } :data
  63. .got.plt : { *(.got.plt) *(.igot.plt) } :data
  64. .data :
  65. {
  66. section_data = .;
  67. /* the rest of data segment */
  68. *(.data .data.*);
  69. } :data
  70. .bss :
  71. {
  72. section_bss = .;
  73. *(.bss)
  74. *(COMMON)
  75. } :data
  76. __data_end = .;
  77. . = DATA_SEGMENT_END(.);
  78. }