[EMAIL PROTECTED] common2]$ cat foo.c void foo (void) { } [EMAIL PROTECTED] common2]$ cat main.c #include <stdio.h>
#ifdef FOO int foo = FOO; #else int foo; #endif int main () { printf ("foo: %d\n", foo); foo = 200; printf ("foo: %d\n", foo); return 0; } [EMAIL PROTECTED] common2]$ make gcc -g -fPIC -c foo.c gcc -shared -o libfoo.so foo.o gcc -c -o main1.o -g main.c gcc -o foo1 -B./ libfoo.so main1.o -Wl,-rpath,. gcc -c -o main2.o -DFOO=2 -g main.c gcc -o foo2 -B./ libfoo.so main2.o -Wl,-rpath,. /usr/local/bin/ld: Warning: type of symbol `foo' changed from 2 to 1 in main2.o gcc -o foo3 -B./ main1.o libfoo.so -Wl,-rpath,. for f in foo1 foo2 foo3; do echo "Running: $f"; ./$f; \ if [ $? != 0 ]; then echo Failed; fi; done Running: foo1 foo: 84026879 /bin/sh: line 1: 30371 Segmentation fault ./$f Failed Running: foo2 foo: 2 foo: 200 Running: foo3 foo: 0 foo: 200 [EMAIL PROTECTED] common2]$ -- Summary: Inconsistent treatment of common and text Product: binutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: ld AssignedTo: unassigned at sources dot redhat dot com ReportedBy: hjl dot tools at gmail dot com CC: bug-binutils at gnu dot org http://sourceware.org/bugzilla/show_bug.cgi?id=6877 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils