This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Common symbol size change bug


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.

Attachment: bug.tar.gz
Description: GNU Zip compressed data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]