[lld] r187220 - [PECOFF] Replace magic number with llvm::COFF::DataDirectoryIndex value
Rui Ueyama
ruiu at google.com
Fri Jul 26 10:30:36 PDT 2013
Author: ruiu
Date: Fri Jul 26 12:30:36 2013
New Revision: 187220
URL: http://llvm.org/viewvc/llvm-project?rev=187220&view=rev
Log:
[PECOFF] Replace magic number with llvm::COFF::DataDirectoryIndex value
Patch by Ron Ofir.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
Modified: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp?rev=187220&r1=187219&r2=187220&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp Fri Jul 26 12:30:36 2013
@@ -382,7 +382,8 @@ public:
}
void setBaseRelocField(uint32_t addr, uint32_t size) {
- auto *atom = new (_alloc) coff::COFFDataDirectoryAtom(_file, 5);
+ auto *atom = new (_alloc) coff::COFFDataDirectoryAtom(
+ _file, llvm::COFF::DataDirectoryIndex::BASE_RELOCATION_TABLE);
uint64_t offset = atom->ordinal() * sizeof(llvm::object::data_directory);
_atomLayouts.push_back(new (_alloc) AtomLayout(atom, offset, offset));
}
More information about the llvm-commits
mailing list