[all-commits] [llvm/llvm-project] 004138: [llvm-objcopy] Fix --section-add when section cont...
Derek Schuff via All-commits
all-commits at lists.llvm.org
Fri Dec 2 17:00:26 PST 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 0041382198f20fe51d8574363bc91c317c7f3c71
https://github.com/llvm/llvm-project/commit/0041382198f20fe51d8574363bc91c317c7f3c71
Author: Guilhem <guilhem at trail.gg>
Date: 2022-12-02 (Fri, 02 Dec 2022)
Changed paths:
M llvm/lib/ObjCopy/wasm/WasmObjcopy.cpp
M llvm/test/tools/llvm-objcopy/wasm/add-section.test
Log Message:
-----------
[llvm-objcopy] Fix --section-add when section contain empty bytes
Implicit cast between char* and StringRef when writing sections.
Reproduce:
```
$> llvm-objcopy --dump-section=name=name.data out.wasm
$> llvm-objcopy --remove-section=name out.wasm out_no_name.wasm
$> llvm-objcopy --add-section=name=name.data out_no_name.wasm out_new_name.wasm
# With wasm-objdump -h we can see that the name section is not totally copied in the new wasm file (if it actually contain empty bytes)
```
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/D139210
More information about the All-commits
mailing list