Open Enclave  0.15.0

◆ oe_add_vectored_exception_handler()

oe_result_t oe_add_vectored_exception_handler ( bool  is_first_handler,
oe_vectored_exception_handler_t  vectored_handler 
)

OP-TEE provides single-threaded enclaves only, and its ELF loader does not support thread-local relocations.

Hence, any enclave that includes a variable marked with __thread will not only not work, but it will fail to load altogether. Register a new vectored exception handler.

Call this function to add a new vectored exception handler. If successful, the registered handler will be called when an exception happens inside the enclave.

Parameters
[in]is_first_handlerThe parameter indicates that the input handler should be the first exception handler to be called. If it is false, the input handler will be appended to the end of exception handler chain, otherwise it will be added as the first handler in the exception handler chain.
[in]vectored_handlerThe input vectored exception handler to register. It must be a function defined in the enclave. The same handler can only be registered once; a 2nd registration will fail. If the function succeeds, the handler may be removed later by passing it to oe_remove_vectored_exception_handler().
Returns
OE_OK successful
OE_INVALID_PARAMETER a parameter is invalid
OE_FAILURE failed to add handler