capablevms / CHERI-ELF-comp

Other
4 stars 1 forks source link

Handling symbol relocations for all libraries #15

Closed 0152la closed 8 months ago

0152la commented 8 months ago

Currently, after the major rewrite towards dynamic shared objects in #13, we handle the "main" compartment file and library dependencies differently. Specifically, for functions in the "main" compartment file called from library dependencies, we update the addresses at map-time, in order to not do dynamic lookups at runtime (as this would mean jumping from the compartment to the runtime loader, and basically crash, due to bounds errors, as we do not intercept this jump). However, if a library dependency calls a function that is not contained within itself, but needs to be loaded from another library [^1], this will obviously crash.

Some proposals to fix this:

The proposals are in estimated implementation difficulty order. I think my personal preference would be 2 > 1 >>> 3.

[^1]: I believe the current test lua_simple does this with __assert, but I need to debug this. I also plan on adding a simpler test to showcase this, without needing huge libraries.

0152la commented 8 months ago

After in-person discussion with Laurie, we'll be going for option 1 for now.