At the moment errors in relocation processing such as out of range values are not detected or at best trapped by asserts which will not be present in release builds. This patch adds support for checking error return values from applyRelocation() calls and printing an appropriate error message. It also adds support for printing multiple errors rather than just the first one. llvm-svn: 226557
36 lines
1.0 KiB
C++
36 lines
1.0 KiB
C++
//===- lld/ReaderWriter/ELF/Mips/MipsRelocationHandler.h ------------------===//
|
|
//
|
|
// The LLVM Linker
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
#ifndef LLD_READER_WRITER_ELF_MIPS_MIPS_RELOCATION_HANDLER_H
|
|
#define LLD_READER_WRITER_ELF_MIPS_MIPS_RELOCATION_HANDLER_H
|
|
|
|
#include "MipsLinkingContext.h"
|
|
|
|
namespace lld {
|
|
namespace elf {
|
|
|
|
class MipsTargetHandler;
|
|
|
|
class MipsTargetRelocationHandler final : public TargetRelocationHandler {
|
|
public:
|
|
MipsTargetRelocationHandler(MipsTargetLayout<Mips32ElELFType> &layout)
|
|
: _mipsTargetLayout(layout) {}
|
|
|
|
std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
|
|
const lld::AtomLayout &,
|
|
const Reference &) const override;
|
|
|
|
private:
|
|
MipsTargetLayout<Mips32ElELFType> &_mipsTargetLayout;
|
|
};
|
|
|
|
} // elf
|
|
} // lld
|
|
|
|
#endif
|