keystone-enclave / keystone-sdk

SDK for Keystone Enclave - ABI/SBI libraries and sample apps
Other
44 stars 22 forks source link

Clean mechanism for specifying entry point for native eapps #30

Open dkohlbre opened 5 years ago

dkohlbre commented 5 years ago

Currently if you make a native eapp (don't link to libc) without an lds/etc the linker will just choose the first function in the file as the entry point (doesn't see a _start).

We need a simple standard way to specify the entry point at compilation time of the eapp. We don't want to have to coordinate with the host app.

dkohlbre commented 5 years ago

Best solution to this is probably: Have the eapp library contain the entry point, have it always call main(). Same as libc would do.

We may need to de-conflict this with using libc in enclaves as well.

Nisiyama-Suzune commented 5 years ago

Alternatively we may change int main to void _start in native eapps. We may also set a linker flag -e main to direct the entry point to main.

dkohlbre commented 5 years ago

void _start wrapped into an ENCLAVE_START macro or similar is almost certainly the right answer. Lets us make it slightly smarter later on, and keeps it working for now.