summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objcopy/ELF
diff options
context:
space:
mode:
authorJames Henderson <jh7370@my.bristol.ac.uk>2019-04-03 14:40:27 +0000
committerJames Henderson <jh7370@my.bristol.ac.uk>2019-04-03 14:40:27 +0000
commitd931cf3e46fdc75456a10d1cc26369385a3b649e (patch)
tree6bc5e6e3c52396d83ce3bb47af3ef4b3b93c9893 /llvm/test/tools/llvm-objcopy/ELF
parent7f036ab754f154740bc7c62f1aa55804371db588 (diff)
downloadbcm5719-llvm-d931cf3e46fdc75456a10d1cc26369385a3b649e.tar.gz
bcm5719-llvm-d931cf3e46fdc75456a10d1cc26369385a3b649e.zip
[llvm-objcopy] Make section rename/set flags case-insensitive
This fixes https://bugs.llvm.org/show_bug.cgi?id=41305. GNU objcopy --set-section-flags/--rename-section flags are case-insensitive, so this patch updates llvm-objcopy to match. Reviewed by: grimar Differential Revision: https://reviews.llvm.org/D60200 llvm-svn: 357590
Diffstat (limited to 'llvm/test/tools/llvm-objcopy/ELF')
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/rename-section-flag.test8
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/set-section-flags.test10
2 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objcopy/ELF/rename-section-flag.test b/llvm/test/tools/llvm-objcopy/ELF/rename-section-flag.test
index dd3bf69cbf9..d29678d7c74 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/rename-section-flag.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/rename-section-flag.test
@@ -49,6 +49,14 @@
# Invalid flags:
# RUN: not llvm-objcopy --rename-section=.foo=.bar,xyzzy %t %t.xyzzy 2>&1 | FileCheck %s --check-prefix=BAD-FLAG
+# Upper-case flags:
+# RUN: llvm-objcopy --rename-section=.foo=.bar,ALLOC,LOAD,NOLOAD,READONLY,DEBUG,CODE,DATA,ROM,CONTENTS,MERGE,STRINGS,SHARE \
+# RUN: --rename-section=.baz=.blah,ALLOC,LOAD,NOLOAD,READONLY,DEBUG,CODE,DATA,ROM,CONTENTS,MERGE,STRINGS,SHARE %t %t.upper
+# RUN: llvm-readobj --sections %t.upper | FileCheck %s --check-prefixes=CHECK,PROGBITS,ALLOC,EXEC,MERGE,STRINGS
+# RUN: llvm-objcopy --rename-section=.foo=.bar,aLlOc,LoAd,NoLoad,rEAdONly,Debug,codE,DaTa,rOm,CoNtEnTs,mErGe,sTRINGs,SharE \
+# RUN: --rename-section=.baz=.blah,aLlOc,LoAd,NoLoad,rEAdONly,Debug,codE,DaTa,rOm,CoNtEnTs,mErGe,sTRINGs,SharE %t %t.mixed
+# RUN: llvm-readobj --sections %t.mixed | FileCheck %s --check-prefixes=CHECK,PROGBITS,ALLOC,EXEC,MERGE,STRINGS
+
!ELF
FileHeader:
Class: ELFCLASS64
diff --git a/llvm/test/tools/llvm-objcopy/ELF/set-section-flags.test b/llvm/test/tools/llvm-objcopy/ELF/set-section-flags.test
index 512c6725ffa..4ca71b4eb98 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/set-section-flags.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/set-section-flags.test
@@ -57,6 +57,16 @@
# Setting flags for the same section multiple times:
# RUN: not llvm-objcopy --set-section-flags=.foo=alloc --set-section-flags=.foo=load %t %t2 2>&1 | FileCheck %s --check-prefix=MULTIPLE-SETS
+# Upper and mixed-case flags:
+# RUN: llvm-objcopy --set-section-flags=.foo=ALLOC,LOAD,NOLOAD,READONLY,DEBUG,CODE,DATA,ROM,CONTENTS,MERGE,STRINGS,SHARE \
+# RUN: --set-section-flags=.baz=ALLOC,LOAD,NOLOAD,READONLY,DEBUG,CODE,DATA,ROM,CONTENTS,MERGE,STRINGS,SHARE \
+# RUN: --set-section-flags=.rela.baz=ALLOC,LOAD,NOLOAD,READONLY,DEBUG,CODE,DATA,ROM,CONTENTS,MERGE,STRINGS,SHARE %t %t.upper
+# RUN: llvm-readobj --sections %t.upper | FileCheck %s --check-prefixes=CHECK,PROGBITS,ALLOC,EXEC,MERGE,STRINGS
+# RUN: llvm-objcopy --set-section-flags=.foo=aLlOc,LoAd,NoLoad,rEAdONly,Debug,codE,DaTa,rOm,CoNtEnTs,mErGe,sTRINGs,SharE \
+# RUN: --set-section-flags=.baz=aLlOc,LoAd,NoLoad,rEAdONly,Debug,codE,DaTa,rOm,CoNtEnTs,mErGe,sTRINGs,SharE \
+# RUN: --set-section-flags=.rela.baz=aLlOc,LoAd,NoLoad,rEAdONly,Debug,codE,DaTa,rOm,CoNtEnTs,mErGe,sTRINGs,SharE %t %t.mixed
+# RUN: llvm-readobj --sections %t.mixed | FileCheck %s --check-prefixes=CHECK,PROGBITS,ALLOC,EXEC,MERGE,STRINGS
+
!ELF
FileHeader:
Class: ELFCLASS64
OpenPOWER on IntegriCloud