[llvm-objcopy] Reorder --dump-section before --remove-section for ELF
authorSameer Arora <sameerarora101@fb.com>
Fri, 5 Jun 2020 17:42:19 +0000 (10:42 -0700)
committerShoaib Meenai <smeenai@fb.com>
Fri, 5 Jun 2020 17:45:51 +0000 (10:45 -0700)
commita018b538a6177b7fb50bad067ca4e828a85dbf76
treec0bbd976d8a4940ac1316b1cce58ad4bbba3ae9c
parent339156ad63c4c876432a3109b4d4a67a9602836b
[llvm-objcopy] Reorder --dump-section before --remove-section for ELF

Reorder `DumpSection` under `handleArgs` in file `ELFObjcopy.cpp`.
`DumpSection` is placed before `replaceAndRemoveSections` and is
therefore now the first operation under `handleArgs`. Thus, it is now
performed before both `add` and `remove` section operations.

Change for the MachO format at D81123. Together fixes https://bugs.llvm.org/show_bug.cgi?id=44283.

Reviewed By: alexshap, jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D81097
llvm/test/tools/llvm-objcopy/ELF/dump-section-before-add-remove.test [new file with mode: 0644]
llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp