diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-12-20 21:55:13 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-12-20 21:55:13 +0000 |
commit | b96995b67f15110f39c41149543e19c8189abdaf (patch) | |
tree | 1971f6467f0c9a77b68ee72bcba9b89bbea52f08 /llvm/tools | |
parent | fa0a39b7ea7d26d220d018044055197a5284f2b5 (diff) |
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 | 3 | ||||
-rw-r--r-- | llvm/tools/llvm-objcopy/StripOpts.td | 3 | ||||
-rw-r--r-- | llvm/tools/opt/opt.cpp | 1 |
4 files changed, 10 insertions, 3 deletions
diff --git a/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp b/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp index b366c6e559877..2e25a47dde017 100644 --- a/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp +++ b/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp @@ -504,6 +504,12 @@ static Error replaceAndRemoveSections(const CopyConfig &Config, Object &Obj) { return false; if (StringRef(Sec.Name).startswith(".gnu.warning")) return false; + // We keep the .ARM.attribute section to maintain compatibility + // with Debian derived distributions. This is a bug in their + // patchset as documented here: + // https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=943798 + if (Sec.Type == SHT_ARM_ATTRIBUTES) + 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 5fce4fbde539d..757d7e97958d9 100644 --- a/llvm/tools/llvm-objcopy/ObjcopyOpts.td +++ b/llvm/tools/llvm-objcopy/ObjcopyOpts.td @@ -112,7 +112,8 @@ defm set_section_flags def strip_all : Flag<["--"], "strip-all">, HelpText<"Remove non-allocated sections outside segments. " - ".gnu.warning* sections are not removed">; + ".gnu.warning* and .ARM.attribute sections are not " + "removed">; def S : Flag<["-"], "S">, Alias<strip_all>; def strip_all_gnu : Flag<["--"], "strip-all-gnu">, HelpText<"Compatible with GNU objcopy's --strip-all">; diff --git a/llvm/tools/llvm-objcopy/StripOpts.td b/llvm/tools/llvm-objcopy/StripOpts.td index 1d06bb3dfb384..a80a91e744a99 100644 --- a/llvm/tools/llvm-objcopy/StripOpts.td +++ b/llvm/tools/llvm-objcopy/StripOpts.td @@ -40,7 +40,8 @@ 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">; + ".gnu.warning* and .ARM.attribute sections are not " + "removed">; def s : Flag<["-"], "s">, Alias<strip_all>; def no_strip_all : Flag<["--"], "no-strip-all">, HelpText<"Disable --strip-all">; diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index ccf8b073b82b6..2ee028e774f4f 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -523,7 +523,6 @@ int main(int argc, char **argv) { initializeDwarfEHPreparePass(Registry); initializeSafeStackLegacyPassPass(Registry); initializeSjLjEHPreparePass(Registry); - initializeStackProtectorPass(Registry); initializePreISelIntrinsicLoweringLegacyPassPass(Registry); initializeGlobalMergePass(Registry); initializeIndirectBrExpandPassPass(Registry); |