summaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objcopy/ELF
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-12-20 21:55:13 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-12-20 21:55:13 +0000
commitb96995b67f15110f39c41149543e19c8189abdaf (patch)
tree1971f6467f0c9a77b68ee72bcba9b89bbea52f08 /llvm/tools/llvm-objcopy/ELF
parentfa0a39b7ea7d26d220d018044055197a5284f2b5 (diff)
Diffstat (limited to 'llvm/tools/llvm-objcopy/ELF')
-rw-r--r--llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp6
1 files changed, 6 insertions, 0 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;