diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-03-31 23:13:30 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-03-31 23:13:30 +0000 |
commit | 07b8d4e6edfc15ca5812ef82581f96f38e13d292 (patch) | |
tree | 186ce633668eb34d788e66c786c087803e9c2fe7 /clang/tools/driver/cc1as_main.cpp | |
parent | 15262e6703c239e6016a5641bfef3e8f3faf5201 (diff) | |
download | bcm5719-llvm-07b8d4e6edfc15ca5812ef82581f96f38e13d292.tar.gz bcm5719-llvm-07b8d4e6edfc15ca5812ef82581f96f38e13d292.zip |
DebugInfo compression: Enable compression before any sections are created.
For those playing at home this produced some fairly subtle behavior. The
sections created in InitMCObjectFileInfo were created without compressed
debug info (a mistake, but not necessarily /broken). Since these
sections were almost always referenced by the existing MCSection object,
this almost worked.
This got weird when we got to handling the relocations for a section.
See ELFObjectWriter::WriteSection where we compute the true section for
a relocation section by simply stripping the ".rela" prefix and then
looking up that section - doing so hit the compression codepath, looked
up .zdebug_blah and found a newly constructed empty section... thus,
things got weird.
This is untestable without a cross-project test (let me know if people
would prefer that to no testing).
llvm-svn: 205261
Diffstat (limited to 'clang/tools/driver/cc1as_main.cpp')
-rw-r--r-- | clang/tools/driver/cc1as_main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp index c6bc870c0b9..0d06371dc16 100644 --- a/clang/tools/driver/cc1as_main.cpp +++ b/clang/tools/driver/cc1as_main.cpp @@ -304,6 +304,10 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts, // FIXME: This is not pretty. MCContext has a ptr to MCObjectFileInfo and // MCObjectFileInfo needs a MCContext reference in order to initialize itself. std::unique_ptr<MCObjectFileInfo> MOFI(new MCObjectFileInfo()); + + if (Opts.CompressDebugSections) + MAI->setCompressDebugSections(true); + MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &SrcMgr); // FIXME: Assembler behavior can change with -static. MOFI->InitMCObjectFileInfo(Opts.Triple, @@ -320,8 +324,6 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts, Ctx.setCompilationDir(Opts.DebugCompilationDir); if (!Opts.MainFileName.empty()) Ctx.setMainFileName(StringRef(Opts.MainFileName)); - if (Opts.CompressDebugSections) - MAI->setCompressDebugSections(true); // Build up the feature string from the target feature list. std::string FS; |