This is the mail archive of the 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]

Re: Plugin interfaces to do Pettis Hansen style code layout in the gold linker.

> ? 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 in
> particular as that has the biggest change to allow this to happen.

@@ -634,7 +696,7 @@ Plugin_manager::get_input_file(unsigned
 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.

+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
       // 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
   Pluginobj* obj = parameters->options().plugins()->object(
-      static_cast<unsigned int>(reinterpret_cast<intptr_t>(handle)));
+    static_cast<unsigned

And here.

   // Return the Pluginobj associated with the given HANDLE.
-  Pluginobj*
+  Object*
   object(unsigned int handle) const

Update the comment, please.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]