diff options
| author | James Henderson <jh7370@my.bristol.ac.uk> | 2019-03-14 11:23:04 +0000 |
|---|---|---|
| committer | James Henderson <jh7370@my.bristol.ac.uk> | 2019-03-14 11:23:04 +0000 |
| commit | e81f5f91b49677f4fbf545fcd9a742d5de155f0a (patch) | |
| tree | 9bea45ef922664ab363f87a2b3b6fb7e85cfb42c /llvm/tools | |
| parent | 4c4ff13d3c813712a80e030ae0a38ca475df74d9 (diff) | |
| download | bcm5719-llvm-e81f5f91b49677f4fbf545fcd9a742d5de155f0a.tar.gz bcm5719-llvm-e81f5f91b49677f4fbf545fcd9a742d5de155f0a.zip | |
Revert r356129 due to greendragon bot failures
llvm-svn: 356133
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp | 6 | ||||
| -rw-r--r-- | llvm/tools/llvm-objcopy/ObjcopyOpts.td | 19 | ||||
| -rw-r--r-- | llvm/tools/llvm-objcopy/StripOpts.td | 7 |
3 files changed, 15 insertions, 17 deletions
diff --git a/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp b/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp index 250eeea1c81..cbf6a3d2777 100644 --- a/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp +++ b/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp @@ -403,7 +403,7 @@ static Error handleArgs(const CopyConfig &Config, Object &Obj, if (Config.StripSections) { RemovePred = [RemovePred](const SectionBase &Sec) { - return RemovePred(Sec) || Sec.ParentSegment == nullptr; + return RemovePred(Sec) || (Sec.Flags & SHF_ALLOC) == 0; }; } @@ -419,7 +419,7 @@ static Error handleArgs(const CopyConfig &Config, Object &Obj, return true; if (&Sec == Obj.SectionNames) return false; - return (Sec.Flags & SHF_ALLOC) == 0 && Sec.ParentSegment == nullptr; + return (Sec.Flags & SHF_ALLOC) == 0; }; if (Config.StripAll) @@ -430,8 +430,6 @@ static Error handleArgs(const CopyConfig &Config, Object &Obj, return false; if (StringRef(Sec.Name).startswith(".gnu.warning")) return false; - if (Sec.ParentSegment != nullptr) - return false; return (Sec.Flags & SHF_ALLOC) == 0; }; diff --git a/llvm/tools/llvm-objcopy/ObjcopyOpts.td b/llvm/tools/llvm-objcopy/ObjcopyOpts.td index a5f7119e328..44fd01cf4ab 100644 --- a/llvm/tools/llvm-objcopy/ObjcopyOpts.td +++ b/llvm/tools/llvm-objcopy/ObjcopyOpts.td @@ -103,9 +103,10 @@ defm set_section_flags "rom, share, contents, merge, strings.">, MetaVarName<"section=flag1[,flag2,...]">; -def strip_all : Flag<["-", "--"], "strip-all">, - HelpText<"Remove non-allocated sections outside segments. " - ".gnu.warning* sections are not removed">; +def strip_all + : Flag<["-", "--"], "strip-all">, + HelpText< + "Remove non-allocated sections other than .gnu.warning* sections">; def S : Flag<["-"], "S">, Alias<strip_all>; def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">, HelpText<"Compatible with GNU objcopy's --strip-all">; @@ -115,15 +116,13 @@ def g : Flag<["-"], "g">, Alias<strip_debug>, HelpText<"Alias for --strip-debug">; def strip_dwo : Flag<["-", "--"], "strip-dwo">, HelpText<"Remove all DWARF .dwo sections from file">; -def strip_sections - : Flag<["-", "--"], "strip-sections">, - HelpText<"Remove all section headers and all sections not in segments">; -def strip_non_alloc - : Flag<["-", "--"], "strip-non-alloc">, - HelpText<"Remove all non-allocated sections outside segments">; +def strip_sections : Flag<["-", "--"], "strip-sections">, + HelpText<"Remove all section headers">; +def strip_non_alloc : Flag<["-", "--"], "strip-non-alloc">, + HelpText<"Remove all non-allocated sections">; def strip_unneeded : Flag<["-", "--"], "strip-unneeded">, HelpText<"Remove all symbols not needed by relocations">; -defm strip_unneeded_symbol +defm strip_unneeded_symbol : Eq<"strip-unneeded-symbol", "Remove symbol <symbol> if it is not needed by relocations">, MetaVarName<"symbol">; diff --git a/llvm/tools/llvm-objcopy/StripOpts.td b/llvm/tools/llvm-objcopy/StripOpts.td index 40b043a7630..c3f351992a0 100644 --- a/llvm/tools/llvm-objcopy/StripOpts.td +++ b/llvm/tools/llvm-objcopy/StripOpts.td @@ -31,9 +31,10 @@ def preserve_dates : Flag<["-", "--"], "preserve-dates">, HelpText<"Preserve access and modification timestamps">; def p : Flag<["-"], "p">, Alias<preserve_dates>; -def strip_all : Flag<["-", "--"], "strip-all">, - HelpText<"Remove non-allocated sections outside segments. " - ".gnu.warning* sections are not removed">; +def strip_all + : Flag<["-", "--"], "strip-all">, + HelpText< + "Remove non-allocated sections other than .gnu.warning* sections">; def s : Flag<["-"], "s">, Alias<strip_all>; def strip_all_gnu : Flag<["-", "--"], "strip-all-gnu">, |

