forked from OSchip/llvm-project
[PECOFF] Move a utility function used in a pass to Pass.cpp.
The file currently has only one function. Function that is useful both for IdataPass and EdataPass will be added to that file. llvm-svn: 197140
This commit is contained in:
parent
b5e774eb2c
commit
d68304eeee
|
@ -1,6 +1,7 @@
|
||||||
add_lld_library(lldPECOFF
|
add_lld_library(lldPECOFF
|
||||||
IdataPass.cpp
|
IdataPass.cpp
|
||||||
PECOFFLinkingContext.cpp
|
PECOFFLinkingContext.cpp
|
||||||
|
Pass.cpp
|
||||||
ReaderCOFF.cpp
|
ReaderCOFF.cpp
|
||||||
ReaderImportHeader.cpp
|
ReaderImportHeader.cpp
|
||||||
WriterPECOFF.cpp
|
WriterPECOFF.cpp
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "IdataPass.h"
|
#include "IdataPass.h"
|
||||||
|
#include "Pass.h"
|
||||||
|
|
||||||
#include "lld/Core/File.h"
|
#include "lld/Core/File.h"
|
||||||
#include "lld/Core/Pass.h"
|
#include "lld/Core/Pass.h"
|
||||||
|
@ -23,13 +24,6 @@
|
||||||
|
|
||||||
namespace lld {
|
namespace lld {
|
||||||
namespace pecoff {
|
namespace pecoff {
|
||||||
|
|
||||||
static void addDir32NBReloc(COFFBaseDefinedAtom *atom, const Atom *target,
|
|
||||||
size_t offsetInAtom = 0) {
|
|
||||||
atom->addReference(std::unique_ptr<COFFReference>(new COFFReference(
|
|
||||||
target, offsetInAtom, llvm::COFF::IMAGE_REL_I386_DIR32NB)));
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace idata {
|
namespace idata {
|
||||||
|
|
||||||
IdataAtom::IdataAtom(Context &context, std::vector<uint8_t> data)
|
IdataAtom::IdataAtom(Context &context, std::vector<uint8_t> data)
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
//===- lib/ReaderWriter/PECOFF/Pass.cpp -----------------------------------===//
|
||||||
|
//
|
||||||
|
// The LLVM Linker
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "Atoms.h"
|
||||||
|
#include "Pass.h"
|
||||||
|
|
||||||
|
#include "lld/Core/File.h"
|
||||||
|
#include "llvm/Support/COFF.h"
|
||||||
|
|
||||||
|
namespace lld {
|
||||||
|
namespace pecoff {
|
||||||
|
|
||||||
|
void addDir32NBReloc(coff::COFFBaseDefinedAtom *atom, const Atom *target,
|
||||||
|
size_t offsetInAtom) {
|
||||||
|
std::unique_ptr<coff::COFFReference> ref(new coff::COFFReference(
|
||||||
|
target, offsetInAtom, llvm::COFF::IMAGE_REL_I386_DIR32NB));
|
||||||
|
atom->addReference(std::move(ref));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // end namespace pecoff
|
||||||
|
} // end namespace lld
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
//===- lib/ReaderWriter/PECOFF/Pass.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_PE_COFF_PASS_H
|
||||||
|
#define LLD_READER_WRITER_PE_COFF_PASS_H
|
||||||
|
|
||||||
|
#include "Atoms.h"
|
||||||
|
|
||||||
|
namespace lld {
|
||||||
|
namespace pecoff {
|
||||||
|
|
||||||
|
void addDir32NBReloc(coff::COFFBaseDefinedAtom *atom, const Atom *target,
|
||||||
|
size_t offsetInAtom = 0);
|
||||||
|
|
||||||
|
} // namespace pecoff
|
||||||
|
} // namespace lld
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue