[PATCH] D88625: [MC] Redirect fixup symbol to the aliasee (if exists)
James Y Knight via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 13 11:57:12 PDT 2020
jyknight added a comment.
> I have tried adding the expression folding stuff to`MCExpr::evaluateAsRelocatableImpl` but I abandoned that idea because evaluateAsRelocatableImpl does not like a modifier different from VK_None (@PLT). (What does a at plt + 1 do? Relaxing the condition (== VK_None) may work... but the semantics are not very clear.
`a at plt + 1` is perfectly fine -- that turns into a R_X86_64_PLT32 relocation with symbol "a" and addend 1.
The interesting question is what this should do:
b=a+1 # no @plt!
... b at plt
It's certainly impossible to create a PLT referring to a function at address "a+1", in current object formats. So, probably this should be invalid. However, GAS seems to consider the modifier as more of an overall-modifier, resulting in the same thing as `a at plt + 1`. I agree that's probably not something we ought to support, since it seems wrong.
But, it does still seem reasonable to put the !VK_None support into evaluateAsRelocatableImpl -- as long as the resolved MCValue has only a single symbol, no offset and no kind.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88625/new/
https://reviews.llvm.org/D88625
More information about the llvm-commits
mailing list