[PATCH] D62718: [llvm-objcopy] Change handling of output file permissions

Alex Brachet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 23:01:10 PDT 2019


abrachet added a comment.

I think I agree that 2 is our best option here. I think perhaps overlooked is when reading from stdin we don't know what permissions to assign. What I am working on right now just assigns 0775 (the current default for all output files) I don't know if you would think this is worth checking if the object file is marked as executable or not.

> If it is a block/character special file, you probably don't want to change its permission (think: root does llvm-objcopy something /dev/null).

I'm not sure I understand why this is specifically a problem for 3. Perhaps sys::fs::setPermissions (and other routines in sys::fs:: which modify set permission bits) should be changed to be weary about the file's type, but I don't understand why this is specifically a problem for 3. Seems like a problem for every option including how llvm-objcopy currently does this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62718





More information about the llvm-commits mailing list