summaryrefslogtreecommitdiff
path: root/lld/ELF/Writer.h
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-10-12 22:36:31 +0000
committerRui Ueyama <ruiu@google.com>2016-10-12 22:36:31 +0000
commit9d9bfa5832264ba898a68e475142f5e489c91b39 (patch)
tree03aa735fdb20cae47034f2d16c8bd601817e93a5 /lld/ELF/Writer.h
parent85e3a780312c520b122eec4fef5411417b27d0c6 (diff)
Support GNU-style ZLIB-compressed input sections.
Previously, we supported only SHF_COMPRESSED sections because it's new and it's the ELF standard. But there are object files compressed in the GNU style out there, so we had to support it. Sections compressed in the GNU style start with ".zdebug_" and contain different headers than the ELF standard's one. In this patch, getRawCompressedData is responsible to handle it. A tricky thing about GNU-style compressed sections is that we have to rename them when creating output sections. ".zdebug_" prefix implies the section is compressed. We need to rename ".zdebug_" ".debug" because our output sections are not compressed. We do that in this patch.
Diffstat (limited to 'lld/ELF/Writer.h')
-rw-r--r--lld/ELF/Writer.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/lld/ELF/Writer.h b/lld/ELF/Writer.h
index cf1c56019b8..3a380a980bd 100644
--- a/lld/ELF/Writer.h
+++ b/lld/ELF/Writer.h
@@ -10,13 +10,11 @@
#ifndef LLD_ELF_WRITER_H
#define LLD_ELF_WRITER_H
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Allocator.h"
#include <cstdint>
#include <memory>
-namespace llvm {
- class StringRef;
-}
-
namespace lld {
namespace elf {
template <class ELFT> class OutputSectionBase;
@@ -41,7 +39,8 @@ struct PhdrEntry {
bool HasLMA = false;
};
-llvm::StringRef getOutputSectionName(llvm::StringRef Name);
+llvm::StringRef getOutputSectionName(llvm::StringRef Name,
+ llvm::BumpPtrAllocator &Alloc);
template <class ELFT> void reportDiscarded(InputSectionBase<ELFT> *IS);