diff options
| author | Scott Egerton <Scott.Egerton@imgtec.com> | 2016-02-15 16:11:51 +0000 |
|---|---|---|
| committer | Scott Egerton <Scott.Egerton@imgtec.com> | 2016-02-15 16:11:51 +0000 |
| commit | d1aeb056547a04aad1d95f892566c4b720ad4fd5 (patch) | |
| tree | e8034c680b15caed7c9909cf8427e8bf61162a17 /llvm/lib/Target/Mips | |
| parent | 73f1a406264a0168fac8062822a56887682974fc (diff) | |
| download | bcm5719-llvm-d1aeb056547a04aad1d95f892566c4b720ad4fd5.tar.gz bcm5719-llvm-d1aeb056547a04aad1d95f892566c4b720ad4fd5.zip | |
[mips] Implemented the .hword directive.
Summary:
In order to pass the tests, this required marking R_MIPS_16 relocations
as needing to point to the symbol and not the section.
Reviewers: vkalintiris, dsanders
Subscribers: dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D17200
llvm-svn: 260896
Diffstat (limited to 'llvm/lib/Target/Mips')
| -rw-r--r-- | llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 6b812d2f16f..247200b7318 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -6216,6 +6216,11 @@ bool MipsAsmParser::ParseDirective(AsmToken DirectiveID) { return false; } + if (IDVal == ".hword") { + parseDataDirective(2, DirectiveID.getLoc()); + return false; + } + if (IDVal == ".option") return parseDirectiveOption(); diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp index 8967d8414db..b7b07671f6d 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp @@ -412,6 +412,7 @@ bool MipsELFObjectWriter::needsRelocateWithSymbol(const MCSymbol &Sym, case ELF::R_MICROMIPS_LO16: return true; + case ELF::R_MIPS_16: case ELF::R_MIPS_32: if (cast<MCSymbolELF>(Sym).getOther() & ELF::STO_MIPS_MICROMIPS) return true; |

