Question about keywords and declarations in assembly code

Ian Lance Taylor ian@wasabisystems.com
Mon Oct 13 17:18:00 GMT 2003


"Jafa" <jafa@silicondust.com> writes:

> The way I figure it if you have two global variables of the same name then
> you should get a linker error... merging the two may be the worst thing it
> can do. Maybe there is some obscure C spec that requires this - hopfully
> someone will clarify.

There is no spec for it, but it is traditional Unix linker behaviour.
The C standard permits it as an extension.  Existing programs depend
on it.

If you don't like it, use the linker --warn-common option.

Ian



More information about the Binutils mailing list