[ARM] Support .reloc *, R_ARM_NONE, *
authorFangrui Song <maskray@google.com>
Fri, 17 May 2019 02:51:54 +0000 (02:51 +0000)
committerFangrui Song <maskray@google.com>
Fri, 17 May 2019 02:51:54 +0000 (02:51 +0000)
commit43ca0e9eb880dc211e94b2b2a05de715c321ef4e
tree61a8a1821ce7b57f609d4c24c316466b9604bbcb
parenta74d6543745bdc0fb6c3170d65f78934ce1760de
[ARM] Support .reloc *, R_ARM_NONE, *

R_ARM_NONE can be used to create references among sections. When
--gc-sections is used, the referenced section will be retained if the
origin section is retained.

Add a generic MCFixupKind FK_NONE as this kind of no-op relocation is
ubiquitous on ELF and COFF, and probably available on many other binary
formats. See D62014.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D61992

llvm-svn: 360980
llvm/include/llvm/MC/MCFixup.h
llvm/lib/MC/MCAsmBackend.cpp
llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.h
llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp
llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
llvm/lib/Target/Mips/MCTargetDesc/MipsFixupKinds.h
llvm/test/MC/ARM/reloc-directive.s [new file with mode: 0644]