https://sourceware.org/bugzilla/show_bug.cgi?id=22589
--- Comment #11 from Szabolcs Nagy <nsz at gcc dot gnu.org> --- (In reply to Richard Earnshaw from comment #10) > (In reply to Szabolcs Nagy from comment #9) > > i ran into this again and i think the linker could relax 'adrp xN, weaksym' > > into 'mov xN, 0' if weaksym is undefined. > > Static linker or dynamic? The dynamic linker can't change any code segment > during loading, since that would break the code-sharing model used by > SVr4-like systems. I don't see how the static linker can know that a > dynamically loaded library won't provide a definition at run-time, so that > doesn't make a lot of sense to me either. for extern weak reference with dynamic linking yes (but such references have to go through indirection anyway that can turn into 0 already), adrp+add like access only makes sense for hidden weak syms or in case of static linking which is known by the static linker. my use case is hidden weak symbol access. -- You are receiving this mail because: You are on the CC list for the bug.