-1

Because no standard library can be used inside Intel SGX enclave. How to implement dynamic loading inside an Enclave? For example, I have functions foo1() and foo2() in a file with .so extension type.

I need to dynamically load a function inside the Enclave. Then, main function outside Enclave can call the function loaded.

App.cpp

status = ecall_dynamicLoading(enclave_id,func); // func is a function pointer loaded from .so // for example, func = &foo1;

Enclave.cpp

ecall_dynamicLoading(func){ (*func)(/* some inputs */); }

Is it possible?

Thank you.

Redpock
  • 11
  • 1
  • Too broad. Please narrow your question to *a single specific thing* that you are having problems with. Also, please include a [mcve]. – Jesper Juhl Nov 14 '17 at 20:54

1 Answers1

4

By Intel's own documentation, you can not load a shared_object (.so) inside the ENCLAVE. You need to turn it into a static library.

https://software.intel.com/en-us/node/708963 https://software.intel.com/en-us/node/708964

Even then, the static library has a lot of limitations.

Countzen
  • 61
  • 6