This is an archive of the discontinued LLVM Phabricator instance.

[mips] Fix JmpLink to texternalsym and tglobaladdr on mcroMIPS R6
ClosedPublic

Authored by atanasyan on Jul 11 2019, 3:13 AM.

Details

Summary

There is not match for the MipsJmpLink texternalsym and MipsJmpLink tglobaladdr patterns for microMIPS R6. As a result LLVM incorrectly selects the JALRC16 compact 2-byte instruction which takes a target instruction address from a register only and assign R_MIPS_32 relocation for this instruction. This relocation completely overwrites JALRC16 and nearby instructions.

This patch adds missed matching patterns, selects BALC instruction and assign a correct R_MICROMIPS_PC26_S1 relocation.

Diff Detail

Event Timeline

atanasyan created this revision.Jul 11 2019, 3:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2019, 3:13 AM
This revision is now accepted and ready to land.Jul 11 2019, 6:46 AM
This revision was automatically updated to reflect the committed changes.