Common symbol size change bug
H. J. Lu
hjl@lucon.org
Wed Apr 9 23:42:00 GMT 2003
When a normal definition overrides a common symbol, ld complains:
# make
gcc -O -g -c main.c
gcc -O -g -c foo.c
gcc -o foo1 -B./ main.o foo.o
/usr/local/bin/ld: Warning: size of symbol `foo' changed from 8 to 16 in foo.o
gcc -o foo2 -B./ foo.o main.o
for f in foo1 foo2; do echo "Running: $f"; ./$f; \
if [ $? != 0 ]; then echo Failed; fi; done
Running: foo1
0: 0
1: 1
2: 2
3: 3
Running: foo2
0: 0
1: 1
2: 2
3: 3
But ld won't complain if a common symbol follows a normal definition.
I don't think ld should complain. Here is a testcase. Am I missing
something?
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.tar.gz
Type: application/x-gzip
Size: 527 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20030409/fcf372ae/attachment.bin>
More information about the Binutils
mailing list