enclave.lds 1.8 KB

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