llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.11k stars 11.1k forks source link

[llvm-objcopy] Speed up writing of large sections #60577

Open DaanDeMeyer opened 1 year ago

DaanDeMeyer commented 1 year ago

Adding large sections using --add-section is currently very slow because llvm-objcopy copies the entire file into memory and writes it to disk again. It'd be great if llvm-objcopy could use more efficient ways of transferring the sections such as reflinks on copy on write filesystems, sendfile() or the newer copy_file_range() on Linux systems to speed things up.

llvmbot commented 1 year ago

@llvm/issue-subscribers-tools-llvm-objcopy-strip

emaste commented 1 year ago

the newer copy_file_range() on Linux systems

copy_file_range() is available on more than just Linux (any optimizations here should not be limited to Linux)