3 ms·
There might be a 'best of both worlds' idea in there: If mold mmaps the input files instead of reading them, the linker would not trash all cached files, and b
by hyperman1 6y ago
There might be a 'best of both worlds' idea in there: If mold mmaps the input files instead of reading them, the linker would not trash all cached files, and be faster itself as it reuses already cached files.
Now the author seems a smart fellow, so maybe he did just that already, I didn't check the source.
- rui314 6y agomold uses only mmap for file IO. Not only input files but also an output file are mapped to memory using mmap(2).
- baruch 6y agoWouldn't this mean that you need to memcpy around? Maybe async-io (io_uring?) help here by doing zero-copy writes directly from the source. I don't know how much you need to mangle code (GOT/PLT, offsets) and how much it is a straight copy of object to object.