[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Multiple setting of a symbol
From: |
Schwarz, Konrad |
Subject: |
Multiple setting of a symbol |
Date: |
Wed, 9 Aug 2006 21:19:19 +0200 |
Hi,
I recently upgraded to as(1) version 2.16.91 20060320, as distributed by
CodeSourcery for ARM, and notice differences with regards to earlier
versions of as(1) (2.16), as built by myself. (This has caused a lot of
head scratching for me). I can reproduce this behavior with the native
as 2.17.50 20060709, as distributed with Cygwin for x86.
Specifically, given the code
my_variable:
.long X
X = 1
X = 2
the new version assembles the value 1 into my_variable, while the old
version assembles the value 2. (Naturally, in real code, X is
determined by various macros, etc.)
I feel that 2 is the correct value for my_variable, since it is the
value of the symbol X in the object file's symbol table.
I have found the following workaround
my_variable:
.long X1
X = 1
X = 2
X1 = X
The following workaround does not work:
.globl X
.long X
X = 1
X = 2
Interestingly,
.globl X1
.long X1
X = 1
X = 2
X1 = X
does.
I also have seen absolute symbols (which show properly in the listing
produced by -as) being suppressed in the symbol table, not showing up in
the output of nm, objdump -t or available to gdb. However, I do not
have a test case for this.
Regards,
Konrad Schwarz
Konrad Schwarz.vcf
Description: Konrad Schwarz.vcf
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Multiple setting of a symbol,
Schwarz, Konrad <=