[PATCH] D56806: [llvm-objcopy] Fix crash when writing empty binary output

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 24 10:56:06 PST 2019


jakehehrlich accepted this revision.
jakehehrlich added a comment.

Does overwriting a file create a new file? --build-id-link-dir and friends relay on that behavior. In general tools should *never* modify a file in place. Consider any build that uses GN (like Fuchsia, or Chromeium, and now optionally llvm/clang). Say they have a rule (like how we strip in Fuchsia) that writes a file. Now say a copy rule is used to put that somewhere else or you use --build-id-link-dir to copy into a .build-id directory (both happen in Fuchsia). The correct behavior should be for a new file to be created on disk, not modification of the existing one. This for instance keeps the file in the .build-id directory correct. I think this truncates the same existing inode.


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

https://reviews.llvm.org/D56806





More information about the llvm-commits mailing list