This is an archive of the discontinued LLVM Phabricator instance.

PowerPC 32bit: Emit relocation type R_PPC_DTPREL32 for tls variablels.
ClosedPublic

Authored by varunkumare99 on Aug 2 2023, 5:24 PM.

Details

Summary

This patch emits the relocation type R_PPC_DTPREL32 for tls variables, which was previously emitting R_PPC_ADDR32 in power-pc 32bit.

Diff Detail

Event Timeline

varunkumare99 created this revision.Aug 2 2023, 5:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 5:24 PM
varunkumare99 requested review of this revision.Aug 2 2023, 5:24 PM
Herald added a project: Restricted Project. · View Herald Transcript

The patch certainly seems reasonable to me. The test case seems like it could be trimmed down a bit (I don't think all the DWARF directives are needed).

varunkumare99 added a reviewer: nemanjai.

reduced the testcase.

MaskRay added inline comments.Aug 4 2023, 8:11 PM
llvm/test/MC/PowerPC/ppc32-R_PPC_DTPREL32-reloc.s
65

I think we should keep just this directive and delete other directives that are unrelated to the test.

## Used by DW_OP_form_tls_address
.long tls@DTPREL+32768
varunkumare99 added inline comments.Aug 6 2023, 10:36 PM
llvm/test/MC/PowerPC/ppc32-R_PPC_DTPREL32-reloc.s
65

I have updated the testcase, as mentioned.

nemanjai accepted this revision.Aug 6 2023, 10:53 PM

LGTM. Thanks.

This revision is now accepted and ready to land.Aug 6 2023, 10:53 PM
varunkumare99 added a comment.EditedAug 6 2023, 11:13 PM

LGTM. Thanks.

Could you please commit the changes.
Name: Varun Erigila
Email: varunkumare99@gmail.com
Thanks

The test is overly complex as my last comment mentioned. I'll simplify the test case.