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]

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 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


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