main.s (again, only the data section shown):
global test2
data
test2:
.data32 test
.data32 test+4
.data32 test+8
After using gas and linking, we get the same problem: test2 contains
{test, test+8, test+16}. If we merge the two assembly files, the problem
goes away. This screams at us as a linker problem.
To eliminate a general linker error, we took the same code to a Linux box running the same version
of binutils. In fact, we took the Xilinx modified source and configured
for i686-linux-gnu. The problem does not appear when using the x86
version. Seems to us when linking external symbols, the offsets get
broken.