diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-23 18:44:31 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-23 18:44:31 +0000 |
commit | bf1a918461a46bce4bccd4f3f7dbe43a55f9a214 (patch) | |
tree | c02b18f8d0c5f35edf245ec3c8f15819c5f04050 /llvm/tools | |
parent | 974acf1c275b1e407e5e3df25068f2a89f32a5c2 (diff) | |
download | bcm5719-llvm-bf1a918461a46bce4bccd4f3f7dbe43a55f9a214.tar.gz bcm5719-llvm-bf1a918461a46bce4bccd4f3f7dbe43a55f9a214.zip |
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.
llvm-svn: 186978
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index 27fe3acd0cf..133eca48e50 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -253,8 +253,8 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file, offset = file->offset; } if (error_code ec = - MemoryBuffer::getOpenFile(file->fd, file->name, buffer, file->filesize, - -1, offset, false)) { + MemoryBuffer::getOpenFile(file->fd, file->name, buffer, -1, + file->filesize, offset, false)) { (*message)(LDPL_ERROR, ec.message().c_str()); return LDPS_ERR; } |