[PATCH] D52303: [lib/MC] - Set SHF_EXCLUDE flag for .dwo sections.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 22 00:38:44 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL342800: [lib/MC] - Set SHF_EXCLUDE flag for .dwo sections. (authored by grimar, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D52303?vs=166284&id=166598#toc
Repository:
rL LLVM
https://reviews.llvm.org/D52303
Files:
llvm/trunk/lib/MC/MCObjectFileInfo.cpp
llvm/trunk/test/MC/ELF/exclude-debug-dwo.s
Index: llvm/trunk/test/MC/ELF/exclude-debug-dwo.s
===================================================================
--- llvm/trunk/test/MC/ELF/exclude-debug-dwo.s
+++ llvm/trunk/test/MC/ELF/exclude-debug-dwo.s
@@ -0,0 +1,32 @@
+# RUN: llvm-mc -triple x86_64-pc-linux-gnu %s -filetype=obj -o %t.o
+# RUN: llvm-readobj -s --elf-output-style=GNU %t.o | FileCheck %s
+
+## Check we add SHF_EXCLUDE flag for .dwo debug sections.
+# CHECK: .debug_info.dwo {{.*}} E
+# CHECK: .debug_types.dwo {{.*}} E
+# CHECK: .debug_abbrev.dwo {{.*}} E
+# CHECK: .debug_str.dwo {{.*}} EMS
+# CHECK: .debug_line.dwo {{.*}} E
+# CHECK: .debug_loc.dwo {{.*}} E
+# CHECK: .debug_str_offsets.dwo {{.*}} E
+
+.section .debug_info.dwo
+nop
+
+.section .debug_types.dwo
+nop
+
+.section .debug_abbrev.dwo
+nop
+
+.section .debug_str.dwo
+nop
+
+.section .debug_line.dwo
+nop
+
+.section .debug_loc.dwo
+nop
+
+.section .debug_str_offsets.dwo
+nop
Index: llvm/trunk/lib/MC/MCObjectFileInfo.cpp
===================================================================
--- llvm/trunk/lib/MC/MCObjectFileInfo.cpp
+++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp
@@ -435,22 +435,22 @@
// Fission Sections
DwarfInfoDWOSection =
- Ctx->getELFSection(".debug_info.dwo", DebugSecType, 0);
+ Ctx->getELFSection(".debug_info.dwo", DebugSecType, ELF::SHF_EXCLUDE);
DwarfTypesDWOSection =
- Ctx->getELFSection(".debug_types.dwo", DebugSecType, 0);
+ Ctx->getELFSection(".debug_types.dwo", DebugSecType, ELF::SHF_EXCLUDE);
DwarfAbbrevDWOSection =
- Ctx->getELFSection(".debug_abbrev.dwo", DebugSecType, 0);
- DwarfStrDWOSection =
- Ctx->getELFSection(".debug_str.dwo", DebugSecType,
- ELF::SHF_MERGE | ELF::SHF_STRINGS, 1, "");
+ Ctx->getELFSection(".debug_abbrev.dwo", DebugSecType, ELF::SHF_EXCLUDE);
+ DwarfStrDWOSection = Ctx->getELFSection(
+ ".debug_str.dwo", DebugSecType,
+ ELF::SHF_MERGE | ELF::SHF_STRINGS | ELF::SHF_EXCLUDE, 1, "");
DwarfLineDWOSection =
- Ctx->getELFSection(".debug_line.dwo", DebugSecType, 0);
+ Ctx->getELFSection(".debug_line.dwo", DebugSecType, ELF::SHF_EXCLUDE);
DwarfLocDWOSection =
- Ctx->getELFSection(".debug_loc.dwo", DebugSecType, 0);
- DwarfStrOffDWOSection =
- Ctx->getELFSection(".debug_str_offsets.dwo", DebugSecType, 0);
+ Ctx->getELFSection(".debug_loc.dwo", DebugSecType, ELF::SHF_EXCLUDE);
+ DwarfStrOffDWOSection = Ctx->getELFSection(".debug_str_offsets.dwo",
+ DebugSecType, ELF::SHF_EXCLUDE);
DwarfRnglistsDWOSection =
- Ctx->getELFSection(".debug_rnglists.dwo", DebugSecType, 0);
+ Ctx->getELFSection(".debug_rnglists.dwo", DebugSecType, ELF::SHF_EXCLUDE);
// DWP Sections
DwarfCUIndexSection =
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52303.166598.patch
Type: text/x-patch
Size: 2819 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180922/30cc3273/attachment.bin>
More information about the llvm-commits
mailing list