diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp --- a/llvm/lib/Support/raw_ostream.cpp +++ b/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 Temp = sys::fs::TempFile::create(OutputFileName + ".temp-stream-%%%%%%", Mode); if (!Temp) diff --git a/llvm/test/tools/llvm-dwarfutil/ELF/X86/file-permissions.test b/llvm/test/tools/llvm-dwarfutil/ELF/X86/file-permissions.test new file mode 100644 --- /dev/null +++ b/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