This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Support assembling %tls_{ie,gd}_pcrel_hi modifiers
ClosedPublic

Authored by lewis-revill on Dec 5 2018, 2:12 PM.

Details

Summary

This patch adds support for parsing and assembling the %tls_ie_pcrel_hi and %tls_gd_pcrel_hi modifiers.

Diff Detail

Repository
rL LLVM

Event Timeline

lewis-revill created this revision.Dec 5 2018, 2:12 PM

Rebased with updated dependency.

Rebased with updated dependency.

jrtc27 requested changes to this revision.Dec 7 2018, 7:51 AM

Please also add some tests to relocations.s like I have done for %got_pcrel_hi.

lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h
95

This will need adding to shouldForceRelocation (along with the GD one) when you rebase. Also, is there a reason these two aren't next to each other (applies throughout the file; I'd try to keep them together and in a consistent order)?

I also wonder if we should call this one fixup_riscv_tls_got_hi20 (and similarly VK_RISCV_TLS_GOT_HI) to match the relocation name like we do for all the other fixups. Otherwise, tls_ie_hi20 is neither the assembly modifier (%tls_ie_pcrel_hi) nor the relocation, but a special hybrid.

This revision now requires changes to proceed.Dec 7 2018, 7:51 AM

Rebased with updated dependencies. Renamed ie_hi to got_hi to match relocation, and rearrange to be adjacent to gd_hi in most files. Added tests to relocations.s, and ensured that fixups evaluate correctly.

lewis-revill retitled this revision from [RISCV, WIP] Support assembling %tls_{ie,gd}_pcrel_hi modifiers to [RISCV] Support assembling %tls_{ie,gd}_pcrel_hi modifiers.

Rebased (assuming updates to D55279)

Rebased with updated dependency

Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2019, 2:12 AM
jrtc27 requested changes to this revision.Feb 5 2019, 9:56 AM
jrtc27 added inline comments.
lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
316

Neither of these should be candidates since they both use the GOT.

This revision now requires changes to proceed.Feb 5 2019, 9:56 AM

Don't incorrectly set RelaxCandidate for GOT fixups.

asb accepted this revision.Apr 10 2019, 3:14 AM

LGTM, thanks!

Rebased prior to commit.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 23 2019, 7:44 AM
This revision was automatically updated to reflect the committed changes.