summaryrefslogtreecommitdiffstats
path: root/tools/gold
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-07-23 18:44:31 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-07-23 18:44:31 +0000
commit963cf75e1cf9a87f0f571919d06adcbf60edd377 (patch)
tree4f9f3383603778d3afed6dcdebd9186946873777 /tools/gold
parent9fd6178dec9531fd44420e2bd121a36a1b9781fc (diff)
downloadexternal_llvm-963cf75e1cf9a87f0f571919d06adcbf60edd377.zip
external_llvm-963cf75e1cf9a87f0f571919d06adcbf60edd377.tar.gz
external_llvm-963cf75e1cf9a87f0f571919d06adcbf60edd377.tar.bz2
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
Diffstat (limited to 'tools/gold')
-rw-r--r--tools/gold/gold-plugin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp
index 27fe3ac..133eca4 100644
--- a/tools/gold/gold-plugin.cpp
+++ b/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;
}