This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Conflicting wchar_t attributes
- From: Paul Brook <paul at codesourcery dot com>
- To: Khem Raj <kraj at mvista dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 27 Jun 2007 14:08:47 +0100
- Subject: Re: Conflicting wchar_t attributes
- References: <640038ED-84E5-40E9-B404-2E21C4C9F37B@mvista.com>
> My question is should merging on the sizes be allowed while linking ?
> As of now ld just rejects it.
The size of wchar_t is an ABI changing option, so IMHO it is reasonable to ld
to refuse to link objects with conflicting options, in the same way that it
refuses to link objects using hard and soft-float calling conventions.
The object attribute is actually a tristate option: 2-byte, 4byte, and "don't
care". The linker will happily merge "don't care" with a specific size.
Ideally objects would only be marked with a specific wchar_t size if they
actually use wchar_t in a public interface. gcc is not currently clever
enough to do that though.
It may be reasonable to have a linker commandline option to ignore object
attribute conflicts.
Paul