https://sourceware.org/bugzilla/show_bug.cgi?id=22589
Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rearnsha at gcc dot gnu.org
--- Comment #3 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
It's simply not safe to use adrp to reference a weak symbol. If you're
hand-writing assembly you have to be aware of this.
adrp is a position-independent address-forming instruction; as such it cannot
ever resolve to zero and still be position independent; that would require
dynamic relocation which would in turn imply having a writable text section.
Furthermore, the offset range of adrp is such that it probably could not
generate zero.
It might be nice if the assembler/linker could detect this case and emit an
out-of-bounds error - it's essentially a relocation overflow. I'm not sure if
that's a generic issue or a back-end one.
Anyway, it's still invalid to use adrp to form a reference to a weak symbol.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils