diff options
author | Rui Ueyama <ruiu@google.com> | 2018-12-04 18:47:44 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2018-12-04 18:47:44 +0000 |
commit | c160a3a4002e69b4b0696ae7d3ee33a84c905db7 (patch) | |
tree | 5b8fa8a4607c8a5f4ab08bb8b91baeaa7ecf9530 /lld/ELF/OutputSections.cpp | |
parent | c18ec9d4a379d3b04a513bcb50860b21c244c76e (diff) |
ELF: allow non allocated sections to go into allocated sections
Patch from Andrew Kelley.
For context, see https://bugs.llvm.org/show_bug.cgi?id=39862
The use case is embedded / OS programming where the kernel wants
access to its own debug info via mapped dwarf info. I have a proof of
concept of this working, using this linker script snippet:
.rodata : ALIGN(4K) {
*(.rodata)
__debug_info_start = .;
KEEP(*(.debug_info))
__debug_info_end = .;
__debug_abbrev_start = .;
KEEP(*(.debug_abbrev))
__debug_abbrev_end = .;
__debug_str_start = .;
KEEP(*(.debug_str))
__debug_str_end = .;
__debug_line_start = .;
KEEP(*(.debug_line))
__debug_line_end =
.;
__debug_ranges_start
= .;
KEEP(*(.debug_ranges))
__debug_ranges_end
= .;
}
Differential revision: https://reviews.llvm.org/D55276
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
-rw-r--r-- | lld/ELF/OutputSections.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 8ad01e34654..c1442c07873 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -95,7 +95,7 @@ void OutputSection::addSection(InputSection *IS) { Flags = IS->Flags; } else { // Otherwise, check if new type or flags are compatible with existing ones. - unsigned Mask = SHF_ALLOC | SHF_TLS | SHF_LINK_ORDER; + unsigned Mask = SHF_TLS | SHF_LINK_ORDER; if ((Flags & Mask) != (IS->Flags & Mask)) error("incompatible section flags for " + Name + "\n>>> " + toString(IS) + ": 0x" + utohexstr(IS->Flags) + "\n>>> output section " + Name + |