This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: typeinfo nodes resolution
- To: Jason Merrill <jason at cygnus dot com>
- Subject: Re: typeinfo nodes resolution
- From: Andrey Slepuhin <pooh at msu dot net>
- Date: Thu, 29 Jan 1998 12:55:45 +0300 (MEST)
- Cc: Jeffrey Law <law at cygnus dot com>, David Edelsohn <dje at watson dot ibm dot com>, egcs at cygnus dot com
- Organization: Moscow State University Network (MSUnet)
On 28-Jan-98 Jason Merrill wrote:
>>>>>> Andrey Slepuhin <pooh@msu.ru> writes:
>
>> On 28-Jan-98 Jason Merrill wrote:
>>>>>>>> Andrey Slepuhin <pooh@msu.net> writes:
>
>>>> this header. The problem is because in the second
>>>> case typeinfo nodes should be generated using ".lcomm"
>>>> assembler directive instead of ".comm", i.e. they
>>>> should not be global.
>
>>> This is wrong. They must be global, as they must be resolved to a single
>>> object. The linker should not warn about such things.
>
>> But what should I do if AIX native linker can not resolve
>> multiple instances, if they are in different shared objects?
>
> Then I guess we have to handle AIX differently. Currently, equality tests
> for type_info nodes just compare addresses; I guess we'll have to use the
> name on AIX.
Grr... This is bad...
Possible workarounds:
1) First check for address equality and may be for equality of hash values
dependent on symbol names;
2) The best solution for AIX may be the following:
a. To add a pointer to an external variable into typeinfo nodes.
(compiler task).
b. To generate an import list for these external variables when
building a shared object (collect2 task).
c. To define these variables in auto-generated C file when building
an executable (collect2 task).
So, pointers will be resolved during program build and will have
equal values for equal typeinfo nodes. I don't know if it is difficult
(or possible at all) to change typeinfo nodes structure for AIX,
but appropriate collect2 changes can be done easy.
Sorry for additional troubles,
Andrey.