[PATCH] D153652: [llvm][Support] Don'tt set "all_exe" mode by default for file written by llvm::writeToOutput.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 26 02:51:49 PDT 2023


hokein updated this revision to Diff 534473.
hokein added a comment.

address comments


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153652

Files:
  llvm/lib/Support/raw_ostream.cpp
  llvm/test/tools/llvm-dwarfutil/ELF/X86/file-permissions.test


Index: llvm/test/tools/llvm-dwarfutil/ELF/X86/file-permissions.test
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-dwarfutil/ELF/X86/file-permissions.test
@@ -0,0 +1,9 @@
+# RUN: yaml2obj %p/Inputs/common.yaml -o %t.o
+# RUN: chmod a+x %t.o
+
+# Verify that the output file preserves the executable bit from the input file.
+# RUN: llvm-dwarfutil --no-garbage-collection %t.o %t1
+# RUN: test -x %t1
+
+# RUN: llvm-dwarfutil --garbage-collection --separate-debug-file %t.o %t2
+# RUN: test -x %t2.debug
Index: llvm/lib/Support/raw_ostream.cpp
===================================================================
--- llvm/lib/Support/raw_ostream.cpp
+++ llvm/lib/Support/raw_ostream.cpp
@@ -1007,7 +1007,7 @@
     return Write(Out);
   }
 
-  unsigned Mode = sys::fs::all_read | sys::fs::all_write | sys::fs::all_exe;
+  unsigned Mode = sys::fs::all_read | sys::fs::all_write;
   Expected<sys::fs::TempFile> Temp =
       sys::fs::TempFile::create(OutputFileName + ".temp-stream-%%%%%%", Mode);
   if (!Temp)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153652.534473.patch
Type: text/x-patch
Size: 1067 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230626/8cf256a0/attachment.bin>


More information about the cfe-commits mailing list