diff options
author | George Rimar <grimar@accesssoftek.com> | 2018-09-22 07:36:20 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2018-09-22 07:36:20 +0000 |
commit | ce95ac64908082abf27cbc23683c1cca0c6719f1 (patch) | |
tree | 846e534eb41d535df399d00f3bb6917213133c99 /llvm/lib/MC/MCObjectFileInfo.cpp | |
parent | 7c9648ff895fc7beba62be8886fb5c17be1ee02b (diff) | |
download | bcm5719-llvm-ce95ac64908082abf27cbc23683c1cca0c6719f1.tar.gz bcm5719-llvm-ce95ac64908082abf27cbc23683c1cca0c6719f1.zip |
[lib/MC] - Set SHF_EXCLUDE flag for .dwo sections.
DWARF5 spec says about single file split case:
"The sections that do not require relocation, however, can be written
to the relocatable object (.o) file but ignored by the
the linker or they can be written to a separate DWARF object (.dwo) file
that need not be accessed by the linker."
Nice way to make linker to ignore them is to set SHF_EXCLUDE flag.
It seems to be not harmful to always set it for .dwo sections.
That is what this patch does.
Differential revision: https://reviews.llvm.org/D52303
llvm-svn: 342800
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r-- | llvm/lib/MC/MCObjectFileInfo.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index 76b8ef9fdf4..0f9070bc7dd 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -435,22 +435,22 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T, bool Large) { // 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 = |