This is an archive of the discontinued LLVM Phabricator instance.

[COFF] create MemoryBuffers without requiring NUL terminators
ClosedPublic

Authored by inglorion on Apr 20 2018, 4:28 PM.

Details

Summary

In a number of places in the COFF linker, we were calling
MemoryBuffer::getFile() with default parameters. This causes LLVM to
NUL-terminate the buffers, which can prevent them from being memory
mapped. Since we operate on binary and do not use NUL as an indicator
of the end of the file content, this change causes us to not require
the NUL terminator anymore.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

inglorion created this revision.Apr 20 2018, 4:28 PM

Anyone able to take a look at this?

ruiu accepted this revision.Apr 24 2018, 4:13 PM
This revision is now accepted and ready to land.Apr 24 2018, 4:13 PM
This revision was automatically updated to reflect the committed changes.