This is an archive of the discontinued LLVM Phabricator instance.

[lld][Hexagon] Add checks for instructions that can have TLS relocations
ClosedPublic

Authored by sidneym on Aug 26 2021, 8:30 AM.

Details

Reviewers
bcain
MaskRay
Summary

Several instructions with potential TLS relocations were missing. This issue was found when building the Canadian LLVM toolchain.

Diff Detail

Event Timeline

sidneym created this revision.Aug 26 2021, 8:30 AM
sidneym requested review of this revision.Aug 26 2021, 8:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2021, 8:30 AM
bcain added a comment.Aug 26 2021, 9:48 AM

The change LGTM, we may want to fix the error message.

lld/ELF/Arch/Hexagon.cpp
239

This error message is inaccurate, right? In this case it's not that relocation mode. If this error case applies to multiple relocations we should probably describe those here instead.

I'm not sure which ones apply but R_HEX_{16_X,TPREL_16} could work. Are there lld idioms about the format of these error messages that we should conform to?

sidneym added inline comments.Aug 26 2021, 3:08 PM
lld/ELF/Arch/Hexagon.cpp
239

It could be changed to 16_X relocation type.

bcain accepted this revision.Aug 26 2021, 8:13 PM
bcain added inline comments.
lld/ELF/Arch/Hexagon.cpp
239

unrecognized instruction for 16_X relocation -- like that? If so, that makes sense.

This revision is now accepted and ready to land.Aug 26 2021, 8:13 PM
sidneym updated this revision to Diff 369967.Sep 1 2021, 10:06 AM
sidneym retitled this revision from [lld][Hexagon] Add check for missing predicated TLS reloc to [lld][Hexagon] Add checks for instructions that can have TLS relocations.
sidneym edited the summary of this revision. (Show Details)
MaskRay accepted this revision.Sep 1 2021, 10:14 AM
sidneym closed this revision.Sep 1 2021, 1:18 PM