]> granicus.if.org Git - llvm/commit
[llvm-objcopy] Implement --set-section-flags.
authorJordan Rupprecht <rupprecht@google.com>
Tue, 29 Jan 2019 15:05:38 +0000 (15:05 +0000)
committerJordan Rupprecht <rupprecht@google.com>
Tue, 29 Jan 2019 15:05:38 +0000 (15:05 +0000)
commitd99c98b3dd50771dc2973e14d0a433149d5c2d21
treef6a142a1346826f60d3080b49c3fd82ea6fa9458
parentdb95f48800114cba2a1742daac62ec2885f67a82
[llvm-objcopy] Implement --set-section-flags.

Summary:
--set-section-flags is used to change the section flags (e.g. SHF_ALLOC) for given sections. The flags allowed are the same from the existing --rename-section=.old=.new[,flags] feature.

Additionally, make sure that --set-section-flag cannot be used with --rename-section (either the source or destination), since --rename-section accepts flags. This avoids ambiguity for something like "--rename-section=.foo=.bar,alloc --set-section-flag=.bar,code".

Reviewers: jhenderson, jakehehrlich, alexshap, espindola

Reviewed By: jhenderson, jakehehrlich

Subscribers: llvm-commits, emaste, arichardson

Differential Revision: https://reviews.llvm.org/D57198

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352505 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-objcopy/ELF/set-section-flags-and-rename.test [new file with mode: 0644]
test/tools/llvm-objcopy/ELF/set-section-flags-multiple.test [new file with mode: 0644]
test/tools/llvm-objcopy/ELF/set-section-flags.test [new file with mode: 0644]
tools/llvm-objcopy/COFF/COFFObjcopy.cpp
tools/llvm-objcopy/CopyConfig.cpp
tools/llvm-objcopy/CopyConfig.h
tools/llvm-objcopy/ELF/ELFObjcopy.cpp
tools/llvm-objcopy/ObjcopyOpts.td