------- Comment #9 from rwild at gcc dot gnu dot org 2010-03-30 16:39 ------- (In reply to comment #2) > Works when linking in comm.o main.o order.
FWIW one can construct test cases where neither order works, e.g., cat >main.c <<\EOF extern int i; int j; int main(void) { i = 0; return i; } EOF cat >comm.c <<\EOF extern int j; int i; int f() { return j; } EOF (libtool likes to produce such code with preload symfiles) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42757