Move calls to get_input_file and release_input_file out of
getModuleForFile(). Otherwise release_input_file may end up
unmapping a view of the file while the view is still being
used by the Module (on 32-bit hosts).
Fix for PR22482.
Differential D7539
Gold-plugin: Broaden scope of get/release_input_file to scope of Module. jvoung on Feb 10 2015, 11:54 AM. Authored by
Details
Move calls to get_input_file and release_input_file out of Fix for PR22482.
Diff Detail
Event TimelineComment Actions When you say "binutils", you mean the bfd ld? I think this is a bug in bfd ld. release_input_file is not supposed to handle views. See Comment Actions I've been testing with gold instead bfd ld. The call chain is roughly this: #0 gold::File_read::View::~View (this=0x86891e8) at ../../../src/binutils/gold/fileread.cc:141 Where line 141 at the top of the stack is: File_read::View::~View() { case DATA_MMAPPED: if (::munmap(const_cast<unsigned char*>(this->data_), this->size_) != 0) //... So are you saying that clear_views() shouldn't be called? |