This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi, Made the changes and attached the new patch. Please also see function get_view in plugin.cc. I made the following change to correct the detection of whether get_view if called from the claim_file_hook. - if (this->objects_.size() == handle) + if (this->in_claim_file_handler_) { // We are being called from the claim_file hook. Thanks, -Sri. On Wed, Jul 13, 2011 at 11:20 AM, Cary Coutant <ccoutant@google.com> wrote: >> ? I made all the changes you mentioned. I removed the >> inspect_unclaimed_object hooks and allowed the functionality to happen >> in claim_file hook, so one handle. Please look at readsyms.cc in >> particular as that has the biggest change to allow this to happen. > > @@ -634,7 +696,7 @@ Plugin_manager::get_input_file(unsigned > ?ld_plugin_status > ?Plugin_manager::release_input_file(unsigned int handle) > ?{ > - ?Pluginobj* obj = this->object(handle); > + ?Pluginobj* obj = this->object(handle)->pluginobj(); > ? if (obj == NULL) > ? ? return LDPS_BAD_HANDLE; > > If there is no ELF object, this->object(handle) might return null. You > need to check that before trying to downcast. > > +Object* > +Plugin_manager::get_elf_object(const void* handle) > +{ > + ?Object* obj = parameters->options().plugins()->object( > + ? ? ?static_cast<unsigned int>(reinterpret_cast<intptr_t>(handle))); > > Doesn't "this->object(...)" work here? > > @@ -659,7 +738,7 @@ Plugin_manager::get_view(unsigned int ha > ? else > ? ? { > ? ? ? // An already claimed file. > - ? ? ?Pluginobj* obj = this->object(handle); > + ? ? ?Pluginobj* obj = this->object(handle)->pluginobj(); > > You need to check for NULL. > > @@ -1321,7 +1399,7 @@ get_symbols(const void* handle, int nsym > ?{ > ? gold_assert(parameters->options().has_plugins()); > ? Pluginobj* obj = parameters->options().plugins()->object( > - ? ? ?static_cast<unsigned int>(reinterpret_cast<intptr_t>(handle))); > + ? ?static_cast<unsigned > int>(reinterpret_cast<intptr_t>(handle)))->pluginobj(); > > And here. > > ? // Return the Pluginobj associated with the given HANDLE. > - ?Pluginobj* > + ?Object* > ? object(unsigned int handle) const > > Update the comment, please. > > -cary >
Attachment:
latest_plugin_patch.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |