Link time checking for incompatible flags

Alan Modra amodra@bigpond.net.au
Thu Apr 22 08:00:00 GMT 2004


On Wed, Apr 21, 2004 at 07:02:24PM -0700, Mike Stump wrote:
> On Wednesday, April 21, 2004, at 06:24 PM, Ian Lance Taylor wrote:
> >The linker currently has no mechanism for anything like this.
> 
> Doesn't it?  The compiler is free to create link once sections that are 
> named something like gcc.options.fshort-enums and place in it a 0 or a 
> 1, and then mark up that section as having the linker validate that the 
> section is the same in all units, and not loaded, and then presto, if 
> you compile two units that differ in this flag, automagic link error?  

No.  GNU ld doesn't compare section contents.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Gcc mailing list