[PATCH] D155732: [MC][COFF][AArch64] Avoid incorrect IMAGE_REL_ARM64_BRANCH26 relocations.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 8 13:35:43 PDT 2023
efriedma added a comment.
In D155732#4570643 <https://reviews.llvm.org/D155732#4570643>, @compnerd wrote:
>> I don't think that we can directly compare what we do to masm; we support an assembler dialect which is not masm, and that includes branching where the destination is an offset from a symbol. Given that, I think we need this logic in WinCOFFObjectWriter, whether or not we emit all temporary symbols. (The change in AArch64AsmBackend.cpp is necessary either way.)
>
> I guess the piece that I'm wondering is why we would need that if the local symbol is available because the label is preserved, the linker should be able to resolve the symbol relative offset and then discard the temporary symbol I thought. What condition am I overlooking?
I was thinking of the case of branching to "x+4", or something like that, where there isn't any existing symbol at the offset in question. We could forbid that, I guess, but it seems like that just shifts complexity elsewhere.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155732/new/
https://reviews.llvm.org/D155732
More information about the llvm-commits
mailing list