4545DECLARE_LOCAL_FUNC get_enclave_base
4646 lea_pic __ImageBase, %xax
4747 ret
48+ .cfi_endproc
49+
4850DECLARE_LOCAL_FUNC get_enclave_state
4951 lea_pic g_enclave_state, %xcx
5052 xor %xax, %xax
5153 movl (%xcx), %eax
5254 ret
55+ .cfi_endproc
56+
5357DECLARE_LOCAL_FUNC set_enclave_state
5458 lea_pic g_enclave_state, %xax
5559#ifdef LINUX32
5660 mov SE_WORDSIZE(%esp ), %edi
5761#endif
5862 movl %edi , (%xax)
5963 ret
64+ .cfi_endproc
6065
6166DECLARE_LOCAL_FUNC lock_enclave
6267 lea_pic g_enclave_state, %xdx
@@ -66,6 +71,7 @@ DECLARE_LOCAL_FUNC lock_enclave
6671 mov $ENCLAVE_INIT_IN_PROGRESS, %ecx /* if (g_global_data.enclave_state == ENCLAVE_INIT_NOT_STARTED) */
6772 lock cmpxchgl %ecx , (%xdx) /* g_global_data.enclave_state == ENCLAVE_INIT_IN_PROGRESS */
6873 ret /* xax: the initial value of enclave state */
74+ .cfi_endproc
6975
7076/*
7177 * ---------------------------------------------------------------------
@@ -77,6 +83,7 @@ DECLARE_LOCAL_FUNC lock_enclave
7783DECLARE_LOCAL_FUNC get_thread_data
7884 READ_TD_DATA self_addr
7985 ret
86+ .cfi_endproc
8087
8188/*
8289 * ---------------------------------------------------------------------
@@ -88,6 +95,7 @@ DECLARE_LOCAL_FUNC get_thread_data
8895DECLARE_LOCAL_FUNC get_stack_guard
8996 READ_TD_DATA stack_guard
9097 ret
98+ .cfi_endproc
9199
92100/*
93101 * ---------------------------------------------------------------------
@@ -113,7 +121,6 @@ DECLARE_GLOBAL_FUNC enclave_entry
113121 * No need to use any register during the dispatch
114122 * ----------------------------------------------------------------------
115123 */
116- .cfi_startproc
117124
118125 /* Clear unused general registers */
119126 xor %xdx, %xdx
@@ -446,6 +453,7 @@ DECLARE_LOCAL_FUNC do_ocall
446453 cld /* DF = 0 */
447454
448455 ENCLU
456+ .cfi_endproc
449457
450458/*
451459 * ------------------------------------------------------------------
@@ -454,7 +462,6 @@ DECLARE_LOCAL_FUNC do_ocall
454462 * ------------------------------------------------------------------
455463 */
456464DECLARE_LOCAL_FUNC __morestack
457- .cfi_startproc
458465 push %xbp
459466 .cfi_def_cfa_offset 2*SE_WORDSIZE
460467 .cfi_offset xbp,-2*SE_WORDSIZE
@@ -518,6 +525,7 @@ DECLARE_GLOBAL_FUNC asm_oret
518525 ret
519526 /* should not come here */
520527 ud2
528+ .cfi_endproc
521529
522530/*
523531 * ------------------------------------------------------------------------
@@ -625,6 +633,7 @@ DECLARE_LOCAL_FUNC do_rdrand
625633 movl %eax , (%xcx)
626634 mov $1 , %xax
627635 ret
636+ .cfi_endproc
628637
629638/*
630639 * -------------------------------------------------------------------------
@@ -635,6 +644,7 @@ DECLARE_LOCAL_FUNC abort
635644 lea_pic g_enclave_state, %xax
636645 movl $ENCLAVE_CRASHED, (%xax)
637646 ud2
647+ .cfi_endproc
638648
639649/*
640650 * -------------------------------------------------------------------------
@@ -692,6 +702,7 @@ DECLARE_LOCAL_FUNC continue_execution
692702 xchg %xax, %xsp
693703
694704 ret $(RED_ZONE_SIZE) /* pop xip and red zone (if any) */
705+ .cfi_endproc
695706
696707/*
697708 * -------------------------------------------------------------------------
@@ -704,4 +715,5 @@ DECLARE_LOCAL_FUNC second_phase
704715 mov $SE_EDECCSSA, %xax
705716 enclu /* DECCSSA */
706717 jmp *%xdx
718+ .cfi_endproc
707719
0 commit comments