Page MenuHomePhabricator

[RISCV] Add R_RISCV_RELAX relocation to all possible relax candidates.
ClosedPublic

Authored by kito-cheng on May 10 2018, 1:17 AM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

kito-cheng created this revision.May 10 2018, 1:17 AM

Changes:

  • Rebase.
  • Change fixup value of R_RISCV_RELAX to a constant 0 value for consistent with binutils's implementation.
asb requested changes to this revision.Aug 15 2018, 8:09 AM
asb added inline comments.
lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
193 ↗(On Diff #146093)

It would make most sense to declare and initialise this alongside Expr/Kind/FixupKind, seeing as like those RelaxCandidate is relevant only for immediates.

261 ↗(On Diff #146093)

Suggest a comment here, something like:
"Ensure an R_RISCV_RELAX relocation will be emitted if linker relaxation is enabled and the current fixup will result in a relocation that may be relaxed."

test/MC/RISCV/linker-relaxation.s
20 ↗(On Diff #146093)

Check you add a check that R_RISCV_RELAX is not generated when -mattr=-relax is used?

This revision now requires changes to proceed.Aug 15 2018, 8:09 AM

Changes:

  • Move declaration of RelaxCandidate.
  • Add comment.
  • Update testcase
asb added a comment.Jan 10 2019, 8:35 AM

I think we've landed enough pre-requisites that this this is good to go in, but it introduces failures to option-pushpop.s and option-relax.s. Can you take a look please?

Okay, I'll take a look :)

Changes:

  • Update testcase, R_RISCV_RELAX won't bind with symbol to fit binutils's behavior.
asb accepted this revision.Jan 17 2019, 7:11 AM

Looks good to me, thanks.

This revision is now accepted and ready to land.Jan 17 2019, 7:11 AM
This revision was automatically updated to reflect the committed changes.