[PECOFF] Replace magic number with llvm::COFF::DataDirectoryIndex value

Patch by Ron Ofir.

llvm-svn: 187220
This commit is contained in:
Rui Ueyama 2013-07-26 17:30:36 +00:00
parent 2b59074ac8
commit 9c3ece328f
1 changed files with 2 additions and 1 deletions

View File

@ -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));
}