This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Plugin interfaces to do Pettis Hansen style code layout in the gold linker.
- From: Cary Coutant <ccoutant at google dot com>
- To: Sriraman Tallam <tmsriram at google dot com>
- Cc: Ian Lance Taylor <iant at google dot com>, binutils <binutils at sourceware dot org>
- Date: Wed, 13 Jul 2011 11:20:07 -0700
- Subject: Re: Plugin interfaces to do Pettis Hansen style code layout in the gold linker.
- References: <AANLkTint2GrjcsfS0cjs1Hgkn4XvoCEQanBv_afztcrX@mail.gmail.com> <AANLkTikX7Z0q27LxNP_nHQnjZHcy0yEavkOo2C4MUcGK@mail.gmail.com> <AANLkTikWfZ_ru7Ltv=t8EOdL+b1xuwj_+wGnH4SaWxde@mail.gmail.com> <AANLkTimwq3L+TkKT3DFtgohfbi+1i-G+kCA0bZTXHkK7@mail.gmail.com> <AANLkTikWow8A06VhQTuhyFAOWupCwnZo8=qxZiq-XxEC@mail.gmail.com> <mcrwrk0xx31.fsf@google.com> <BANLkTikCPFWecCPaz-ZT3VBMJ9Acdx_TeqX=oCfXXWZENK73fQ@mail.gmail.com> <BANLkTimYaS7G3-O+KxOLEQzZ1V0xbB4ORStao4gpU_6dEhgFUA@mail.gmail.com> <BANLkTimKuKEGo8VSQqMFun_EfCj350R9tEpMejD8mmBrOudyiA@mail.gmail.com> <mcrwrfwa02m.fsf@coign.corp.google.com> <CAAs8HmwKLqMbQ7Wj2vVkXD9Nqw49RVxZiavAgPiOr_W4zm=7Sg@mail.gmail.com>
> ? 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