Support for R_MIPS_NONE allows us to parse MIPS16's usage of .reloc.
R_MIPS_32 was included to be able to better test the directive.
Targets can add their relocations by overriding MCAsmBackend::getFixupKind().
Paths
| Differential D13659
Implement .reloc (constant offset only) with support for R_MIPS_NONE and R_MIPS_32. ClosedPublic Authored by dsanders on Oct 12 2015, 8:49 AM.
Details Summary Support for R_MIPS_NONE allows us to parse MIPS16's usage of .reloc. Targets can add their relocations by overriding MCAsmBackend::getFixupKind().
Diff Detail Event Timelinemajnemer added inline comments.
Comment Actions Thanks
Comment Actions Fix all review comments except for the addend hook which I'm still thinking
Comment Actions What happens when you do: .text .long .text+2 .reloc 0, R_MIPS_32, .text+3
Comment Actions
I get: Disassembly of section .text: 00000000 <.text>: 0: 00000005 lsa zero,zero,zero,0x1 0: R_MIPS_32 .text 0: R_MIPS_32 .text ... The two addends are summed and stored in the section while two R_MIPS_32 relocs for .text are emitted.
Comment Actions Moved .reloc related things near to .value related things. Closed by commit rL252888: Implement .reloc (constant offset only) with support for R_MIPS_NONE and… (authored by dsanders). · Explain WhyNov 12 2015, 5:35 AM This revision was automatically updated to reflect the committed changes. Comment Actions I committed this in r252888 since I have an LGTM from David and there have been no further comments in the last two weeks.
Revision Contents
Diff 38584 include/llvm/MC/MCAsmBackend.h
include/llvm/MC/MCObjectStreamer.h
include/llvm/MC/MCStreamer.h
lib/MC/MCAsmBackend.cpp
lib/MC/MCAsmStreamer.cpp
lib/MC/MCObjectStreamer.cpp
lib/MC/MCParser/AsmParser.cpp
lib/Target/Mips/MCTargetDesc/MipsAsmBackend.h
lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp
lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
lib/Target/Mips/MCTargetDesc/MipsFixupKinds.h
test/MC/Mips/reloc-directive.s
|
Will there be any direct calls of this? If not, I'd just drop the default argument.