https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108515
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Richard Earnshaw from comment #10) > Almost certainly this is related to the need for a copyreloc and presumably > the linker has not created one for some reason. So I suspect this is most > likely a binutils issue rather than a compiler one. The code generated for > the simple test is just > > main: > @ args = 0, pretend = 0, frame = 0 > @ frame_needed = 0, uses_anonymous_args = 0 > movw r3, #:lower16:stderr > movt r3, #:upper16:stderr > push {r4, lr} > movw r0, #:lower16:.LC0 > movt r0, #:upper16:.LC0 > ldr r1, [r3] > bl printf > mov r0, #0 > pop {r4, pc} > > And the references to stderr will require the definition to be moved from > the shared library to the static image during linking. So eventually linking with -Wl,-z,nocopyreloc will fail?