Add R_RISCV_RELAX relocation to all possible relax candidates and corresponding testcase.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Changes:
- Rebase.
- Change fixup value of R_RISCV_RELAX to a constant 0 value for consistent with binutils's implementation.
lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp | ||
---|---|---|
193 | 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 | Suggest a comment here, something like: | |
test/MC/RISCV/linker-relaxation.s | ||
20 | Check you add a check that R_RISCV_RELAX is not generated when -mattr=-relax is used? |
Comment Actions
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?
Comment Actions
Changes:
- Update testcase, R_RISCV_RELAX won't bind with symbol to fit binutils's behavior.
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."