Skip to content

Commit 9c3ece3

Browse files
committed
[PECOFF] Replace magic number with llvm::COFF::DataDirectoryIndex value
Patch by Ron Ofir. llvm-svn: 187220
1 parent 2b59074 commit 9c3ece3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ class DataDirectoryChunk : public AtomChunk {
382382
}
383383

384384
void setBaseRelocField(uint32_t addr, uint32_t size) {
385-
auto *atom = new (_alloc) coff::COFFDataDirectoryAtom(_file, 5);
385+
auto *atom = new (_alloc) coff::COFFDataDirectoryAtom(
386+
_file, llvm::COFF::DataDirectoryIndex::BASE_RELOCATION_TABLE);
386387
uint64_t offset = atom->ordinal() * sizeof(llvm::object::data_directory);
387388
_atomLayouts.push_back(new (_alloc) AtomLayout(atom, offset, offset));
388389
}

0 commit comments

Comments
 (0)