as /dev/null -o a.o echo '.globl foo; .type foo,@function; foo:' > b.s && gcc -c b.s -o b.o && ar rc b.a b.o echo 'call foo' > c.s && gcc -shared c.s -o c.so # GNU ld correctly fetches b.a(b.o) ld.bfd a.o --start-group b.a c.so --end-group -y foo # ld.bfd: c.so: reference to foo # ld.bfd: b.a(b.o): definition of foo # gold incorrectly errors. It should fetch b.a(b.o) gold a.o --start-group b.a c.so --end-group -y foo # c.so: reference to foo # c.so: error: undefined reference to 'foo'