[PATCH] D118189: [llvm-objcopy][COFF] Implement --update-section

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 11:17:50 PST 2022


MaskRay added a comment.

In D118189#3275535 <https://reviews.llvm.org/D118189#3275535>, @mstorsjo wrote:

> This looks sensible to me, thanks!
>
> I think we should let @jhenderson have a look at it still though. I think he's out at the moment, but he's hopefully back soon. (Then again, the 14.x branch is happening soon, and in case he's not back before then, and if you have a need to have this included in the branch, I think it could be ok to go ahead sooner, and deal with other feedback later.)

Sounds good.



================
Comment at: llvm/test/tools/llvm-objcopy/COFF/update-section.test:10
+
+# RUN: llvm-objcopy --update-section=.text=%t.smaller %t - | obj2yaml | FileCheck %s --check-prefix=SMALLER
+# SMALLER: SectionData: '41414100'
----------------
Use `llvm-readobj -S -x .text` to test the section header and dump the content.



================
Comment at: llvm/test/tools/llvm-objcopy/COFF/update-section.test:20
+# NO-SECTION: error: {{.*}}could not find section with name '.noexist'
+
+--- !COFF
----------------
Add a test for an `IMAGE_SCN_CNT_UNINITIALIZED_DATA` section like `.bss`. There should be an error similar to ELF `SHT_NOBITS`


================
Comment at: llvm/test/tools/llvm-objcopy/COFF/update-section.test:26
+sections:
+  - Name:            .text
+    Characteristics: [  ]
----------------
Consider adding another section and testing two `--update-section`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118189/new/

https://reviews.llvm.org/D118189



More information about the llvm-commits mailing list