This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [PATCH 1/3] Add native ELF and LTO support in collect2


>   I'm not clear here: by "an ELF plugin", do you mean one that would return
> the native ELF symbols rather than LTO ones?  Wouldn't need to be a new plugin
> at all, that could easily be done by sending a plugin option to the existing one.

The existing plugin only does LTO, not native ELF.
 
> > One thing I considered was calling nm with plugin or calling
> > a new lto-nm I wrote, but just doing it directly was much nicer.
> 
>   Or, as you say, could use nm with the plugin.  I think reusing code is
> "nicer" than copy-pasting it with minor variations into multiple locations.  I
> think it would be really nice clean design if we had just one plugin, capable
> of doing "whatever we want", and used it in as many locations as we can, using
> a consistent plugin API.

I think you're missing the point. collect2 does far more than the linker plugin 
does.

e.g. it scans for all kinds of different sections and does other special
magic, which is not done by the LTO plugin which just looks through the 
symbol table.

The code to read the LTO symbol table is also quite small, about 40 lines
or so. I don't think it makes sense to go through connotations just
to share it.  The code to dynamically link the plugin would be also far
from being system independent.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.


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