On Thu, 2020-08-06 at 11:02 +0300, Nadav Har'El wrote:

> We have a trick that will do both the on-load symbol resolution and
> loading the entire object
> and not page by page: If you add:
> 
> asm(".pushsection .note.osv-mlock, \"a\"; .long 0, 0, 0;
> .popsection");
> 
> To your source code, both things will auto-magically happen :-)
> We have in <osv/elf.hh> a macro doing this, OSV_ELF_MLOCK_OBJECT(),
> but you don't really need that macro, you can just copy this line.
> 
> I suggest you use this trick, instead of the "z,now" thing.

Thanks for the great explaination - and yes, that does indeed sort the
issue, thanks ;)

> Unless you executable is huge, I don't think you'll have problems
> doing this for the entire executable (you only need this "section"
> thing in one place in your source code), but if that bothers you, you
> can always put the problematic code in a separate shared object, and
> only that object will be marked with this special section.

Understood. I'll see how we get on, but we have your backup plan
anyway.

Thanks again. I'll try and get my patch into something that could be
applied, as I know there are others looking to do similar things.

cheers,
Rick


-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/bdc13eabd2a9c974e88699eaef5481dc11b25dad.camel%40rossfell.co.uk.

Reply via email to