The addend for a PCRel4 reloc should be -4 too.

This commit is contained in:
Dan Gohman
2018-04-09 06:15:33 -07:00
parent 781d3ee3ff
commit b0d414731c
3 changed files with 5 additions and 3 deletions

View File

@@ -1007,9 +1007,11 @@ call_id = TailRecipe(
'call_id', Call, size=4, ins=(), outs=(),
emit='''
PUT_OP(bits, BASE_REX, sink);
// The addend adjusts for the difference between the end of the
// instruction and the beginning of the immediate field.
sink.reloc_external(Reloc::IntelPCRel4,
&func.dfg.ext_funcs[func_ref].name,
0);
-4);
sink.put4(0);
''')