diff options
author | Simon Atanasyan <simon@atanasyan.com> | 2015-04-04 19:13:32 +0000 |
---|---|---|
committer | Simon Atanasyan <simon@atanasyan.com> | 2015-04-04 19:13:32 +0000 |
commit | c3899d22342fcaef6b02b22c136b3e06ea918f95 (patch) | |
tree | 437c4e8a992a6d03fc4d5cb402509917acb386cd /lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp | |
parent | 090132563b35651dc1ae67495b96bb781e68f9bd (diff) | |
download | bcm5719-llvm-c3899d22342fcaef6b02b22c136b3e06ea918f95.tar.gz bcm5719-llvm-c3899d22342fcaef6b02b22c136b3e06ea918f95.zip |
[Mips] Support writing .reginfo section into the linked file
In case of MIPS O32 ABI linker should merge registers usage masks stored
in the input .reginfo sections and save result into the output .reginfo
section.
The ABI states that the .reginfo section should be put into the separate
segment. This requirement is not implemented in this patch.
llvm-svn: 234103
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp')
-rw-r--r-- | lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp b/lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp index ea91fcfd6de..fcbd72471ee 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.cpp @@ -47,10 +47,22 @@ std::error_code MipsLinkingContext::mergeHeaderFlags(uint8_t fileClass, return _flagsMerger.mergeHeaderFlags(fileClass, flags); } +void MipsLinkingContext::mergeReginfoMask(const MipsReginfo &info) { + if (_reginfoMask.hasValue()) + _reginfoMask->merge(info); + else + _reginfoMask = info; +} + uint32_t MipsLinkingContext::getMergedELFFlags() const { return _flagsMerger.getMergedELFFlags(); } +const llvm::Optional<MipsReginfo> & +MipsLinkingContext::getMergeReginfoMask() const { + return _reginfoMask; +} + uint64_t MipsLinkingContext::getBaseAddress() const { if (_baseAddress == 0 && getOutputELFType() == llvm::ELF::ET_EXEC) return getTriple().isArch64Bit() ? 0x120000000 : 0x400000; |