Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Commit

Permalink
RewriteInstance: account .stab and .stabstr as debug sections
Browse files Browse the repository at this point in the history
Summary:
.stab and .stabstr are special sections containing debugging
information and strings associated with the debugging information.
This commit adds them to the list of debugging sections, so
these sections can be removed for output binary.

Vasily Leonenko,
Advanced Software Technology Lab, Huawei
  • Loading branch information
Vasily Leonenko authored and rafaelauler committed Jul 21, 2021
1 parent eef829b commit 27e6ac1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bolt/src/RewriteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5425,7 +5425,8 @@ bool RewriteInstance::willOverwriteSection(StringRef SectionName) {
}

bool RewriteInstance::isDebugSection(StringRef SectionName) {
if (SectionName.startswith(".debug_") || SectionName == ".gdb_index")
if (SectionName.startswith(".debug_") || SectionName == ".gdb_index" ||
SectionName == ".stab" || SectionName == ".stabstr")
return true;

return false;
Expand Down

0 comments on commit 27e6ac1

Please sign in to comment.