diff options
author | Rui Ueyama <ruiu@google.com> | 2013-12-12 10:01:14 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2013-12-12 10:01:14 +0000 |
commit | d68304eeee368582a84bec790b7dccb3d8b71091 (patch) | |
tree | 7e13237e4bc697e0a2ae95a2cdf1c0b4ac6b4674 /lld/lib/ReaderWriter/PECOFF/Pass.cpp | |
parent | b5e774eb2cf2757a48826dab3dd962008117d482 (diff) | |
download | bcm5719-llvm-d68304eeee368582a84bec790b7dccb3d8b71091.tar.gz bcm5719-llvm-d68304eeee368582a84bec790b7dccb3d8b71091.zip |
[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
Diffstat (limited to 'lld/lib/ReaderWriter/PECOFF/Pass.cpp')
-rw-r--r-- | lld/lib/ReaderWriter/PECOFF/Pass.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/PECOFF/Pass.cpp b/lld/lib/ReaderWriter/PECOFF/Pass.cpp new file mode 100644 index 00000000000..88d4e5f020c --- /dev/null +++ b/lld/lib/ReaderWriter/PECOFF/Pass.cpp @@ -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 + |