On Mon, 12 Feb 2007, Andreas Schwab wrote:

Mikulas Patocka <[EMAIL PROTECTED]> writes:

__asm__ (".global number; number = 0x12345678");
extern void number;

These two declarations are not compatible.  The latter declares number as
a data symbol, but the former defines it is an absolute symbol.  Thus what
you get is undefined behaviour.

Andreas.

Hi

I thought that .types do not care for linking, I never ran into problem with different .types on symbols. BTW. if you look at assembler, there are no .type directives regarding "number" at all.

How otherwise should external C variables be placed at absolute locations? (I need variables and function on absolute locations quite often and I always used this method)

Mikulas


_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to