gold should provide more info to help user identify the issue: [hjl@gnu-tools-1 pr17935]$ cat foo.s .text .globl foo foo: .byte 0 .globl bar bar: .dc.a foo [hjl@gnu-tools-1 pr17935]$ make gcc -m32 -c -o foo.o foo.s ld.gold -m elf_i386 -z text -shared -o libfoo.so foo.o ld.gold: error: read-only segment has dynamic relocations Makefile:19: recipe for target 'libfoo.so' failed make: *** [libfoo.so] Error 1 ld issue a warning: [hjl@gnu-tools-1 pr17935]$ ./ld -m elf_i386 -z text -shared -o libfoo.so foo.o ./ld: foo.o: warning: relocation against `foo' in readonly section `.text' ./ld: read-only segment has dynamic relocations. [hjl@gnu-tools-1 pr17935]$ It is very useful to identify which input causes the error.