llvm.org GIT mirror llvm / 963cf75
Fix use of the getOpenFile api. The gold plugin was passing the desired map size as the file size. This was working for two reasons: * Recent version of gold provide the get_view callback, so this code was not used. * In older versions, getOpenFile was called, but the file size is never used if we don't require null terminated buffers and map size defaults to the file size. Thanks to Eli Bendersky for noticing this. I will try to make this api a bit less error prone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186978 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
252252 offset = file->offset;
253253 }
254254 if (error_code ec =
255 MemoryBuffer::getOpenFile(file->fd, file->name, buffer, file->filesize,
256 -1, offset, false)) {
255 MemoryBuffer::getOpenFile(file->fd, file->name, buffer, -1,
256 file->filesize, offset, false)) {
257257 (*message)(LDPL_ERROR, ec.message().c_str());
258258 return LDPS_ERR;
259259 }