[PATCH] D47755: [RISCV] Insert R_RISCV_ALIGN relocation type and Nops for code alignment when linker relaxation enabled

Shiva Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 17 22:48:07 PST 2019


shiva0217 updated this revision to Diff 182459.
shiva0217 edited the summary of this revision.
shiva0217 added a comment.

Hi @asb, I got your point, we could guard the target hook with `AF.hasEmitNops()`, so the behavior of `.align 4, 1` will be the same as gnu assembler. What do you think?

I've tested .align in data section when relaxation enabled for gnu toolchain, gnu toolchain will not insert R_RISCV_ALIGN, and the alignment position will be correct. It seems that we only need to insert R_RISCV_ALIGN for the relaxable section. As far as I know, it would be code section, but I may miss something.

The target hook's names and comments have been updated, thanks for the revision.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D47755/new/

https://reviews.llvm.org/D47755

Files:
  include/llvm/MC/MCAsmBackend.h
  lib/MC/MCAssembler.cpp
  lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
  lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h
  lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp
  lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h
  test/MC/RISCV/align.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47755.182459.patch
Type: text/x-patch
Size: 12517 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190118/14d62ed9/attachment.bin>


More information about the llvm-commits mailing list