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

Re: static data member problem


Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> writes:

> 	So the beginner's question is: is it possible (well it's 
> always possible, I mean is it a good solution) to make -frepo 
> used by default (at configure time) for those architectures ??

It certainly is, but it won't solve all the problems.  The first on
that comes to my mind is that -frepo will only work if you compile and 
link in two separate steps.  Moreover, it won't work for libraries.

My idea was more on the line of emulating weak definitions by
generating code for them as if they were members of anonymous
namespaces.  Then, at link time, collect2 could extract the required
pieces of code from the object file, rename the symbols so as to match 
their original names, then link everything together.

I'm not sure it is possible to extract information like that from
object files, though.  Another solution would be to write the assembly
code (text) of the ``weak'' definitions into the object file, in a way
that collect2 could extract it, generate a single assembly file
containing all the weak definitions, assemble it and link it together
with the other object files.

Is any of these approaches possible?

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



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