-
Notifications
You must be signed in to change notification settings - Fork 86
Make aep_trampoline.S relocatable #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
thanks for opening this PR! Not sure in which exact scenario we need this? Is this related to the Rust bindings (#78 )? Also, don't we have to do this as well for other .S files like irq_entry.S? |
I don't think it is related to #78, but it's something I had to do when trying to build I'm not sure if we should do this in other |
I see, is there a reason to compile libsgxstep with -fPIC though? |
Perhaps my use case is a bit niche, but I was using a program that loads a |
makes sense, thanks for clarifying. In fact, I've already longer wanted to enable LD_PRELOADing libsgxstep into a standard application (cf #28 ) to dynamically hook into enclave entries. So putting this on the list to figure out and upstream! |
It turns out that we do. I was not running into this before, because I did not include these files when linking because these files were not used. When linking with |
I found this very helpful: https://stackoverflow.com/a/66713969 TL;DR
so in your patch above, |
Elementary PoC works, needs further testing. Cf #76
96c6ca6
to
09b379d
Compare
Closing this PR, as the correct implementation is in 15e89a9 which will be merged later. |
Upstreaming some changes in my personal fork. If I recall correctly, this change to
aep_trampoline.S
was necessary to makelibsgxstep
relocatable. Without these changes, it is not possible to linklibsgxstep
in a shared object.