[PATCH] [SPARC] Repair GOT references to internal symbols.
James Y Knight
jyknight at google.com
Thu Jun 18 08:11:17 PDT 2015
VK_Sparc_GOT22, VK_Sparc_PC22, and VK_Sparc_HI all print as "%hi(name)", so
you can't tell which one was going to be emitted in a .o by looking at the
assembly -- and llvm could've gotten it wrong without it showing in the
asm. At parse time, the asm parser has to choose which relocation type to
turn that ambiguous expression back into.
Of course it's stupid that they all share the same assembly syntax, but...
On Thu, Jun 18, 2015 at 7:33 AM, Rafael Espíndola <
rafael.espindola at gmail.com> wrote:
> >> Could this be changed to used llvm-mc? If not, what asm parsing feature
> that is missing?
> >> It can be done in another commit, but we should get to it.
> > llvm-mc is tested in the other test case changed here. But, having a
> case for directly emitting relocs separate from going through textual asm
> is valuable, at the least because the "%hi" asm directive can parse into 3
> different relocation types, depending on context. It'd be entirely
> plausible to have a bug that outputs an incorrect relocation in direct
> object writing, but have it turn out right after going through asm
> How? If it prints the correct assembly (and we have a test for that)
> and the correct assembly produces the correct .o (and we have a test
> for that), what code path is missed that has a bug when producing a .o
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits