This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: Conflicting wchar_t attributes


> 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


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