summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-06-01 21:52:41 +0000
committerZachary Turner <zturner@google.com>2017-06-01 21:52:41 +0000
commitebd3ae8371b4ca7b4c9c0bd62f28babaaf25a633 (patch)
tree17fdc737dd47911abd76029d670ff96b10860285 /llvm/tools/llvm-readobj
parent678aa336fa8d0cfac176d3bd95ddb96f545bbe68 (diff)
downloadbcm5719-llvm-ebd3ae8371b4ca7b4c9c0bd62f28babaaf25a633.tar.gz
bcm5719-llvm-ebd3ae8371b4ca7b4c9c0bd62f28babaaf25a633.zip
[CodeView] Properly align symbol records on read/write.
Object files have symbol records not aligned to any particular boundary (e.g. 1-byte aligned), while PDB files have symbol records padded to 4-byte aligned boundaries. Since they share the same reading / writing code, we have to provide an option to specify the alignment and propagate it up to the producer or consumer who knows what the alignment is supposed to be for the given container type. Added a test for this by modifying the existing PDB -> YAML -> PDB round-tripping code to round trip symbol records as well as types. Differential Revision: https://reviews.llvm.org/D33785 llvm-svn: 304484
Diffstat (limited to 'llvm/tools/llvm-readobj')
-rw-r--r--llvm/tools/llvm-readobj/COFFDumper.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp
index 663f7b4c8a8..bc07bd296ad 100644
--- a/llvm/tools/llvm-readobj/COFFDumper.cpp
+++ b/llvm/tools/llvm-readobj/COFFDumper.cpp
@@ -978,7 +978,8 @@ void COFFDumper::printCodeViewSymbolsSubsection(StringRef Subsection,
Subsection.bytes_end());
auto CODD = llvm::make_unique<COFFObjectDumpDelegate>(*this, Section, Obj,
SectionContents);
- CVSymbolDumper CVSD(W, Types, std::move(CODD), opts::CodeViewSubsectionBytes);
+ CVSymbolDumper CVSD(W, Types, CodeViewContainer::ObjectFile, std::move(CODD),
+ opts::CodeViewSubsectionBytes);
CVSymbolArray Symbols;
BinaryStreamReader Reader(BinaryData, llvm::support::little);
if (auto EC = Reader.readArray(Symbols, Reader.getLength())) {
OpenPOWER on IntegriCloud