1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/lib
Fangrui Song 3afa7d901e [llvm-objcopy] Don't change permissions of non-regular output files
There is currently an EPERM error when a regular user executes `llvm-objcopy a.o /dev/null`.
Worse, root can even change the mode bits of /dev/null.

Fix it by checking if the output file is special.

A new overload of llvm::sys::fs::setPermissions with FD as the parameter
is added. Users should provide `perm & ~umask` as the parameter if they
intend to respect umask.

The existing overload of llvm::sys::fs::setPermissions may be deleted if
we can find an implementation of fchmod() on Windows. fchmod() is
usually better than chmod() because it saves syscalls and can avoid race
condition.

Reviewed By: jakehehrlich, jhenderson

Differential Revision: https://reviews.llvm.org/D64236

llvm-svn: 365753
2019-07-11 10:17:59 +00:00
..
Analysis [SCEV] teach SCEV symbolical execution about overflow intrinsics folding. 2019-07-11 02:18:22 +00:00
AsmParser
BinaryFormat [Object][XCOFF] Add support for 64-bit file header and section header dumping. 2019-07-09 18:09:11 +00:00
Bitcode [BitcodeReader] Validate OpNum, before accessing Record array. 2019-07-11 09:57:00 +00:00
Bitstream
CodeGen [SDAG] commute setcc operands to match a subtract 2019-07-10 23:23:54 +00:00
DebugInfo [DwarfDebug] Dump call site debug info 2019-07-09 11:33:56 +00:00
Demangle
ExecutionEngine [ORC] Add custom IR compiler configuration to LLJITBuilder to enable obj caches. 2019-07-10 17:24:24 +00:00
Fuzzer
FuzzMutate
IR Replace three "strip & accumulate" implementations with a single one 2019-07-11 01:14:48 +00:00
IRReader
LineEditor
Linker
LTO [Support] Move llvm::MemoryBuffer to sys::fs::file_t 2019-07-10 00:34:13 +00:00
MC Revert "[ELF] Loose a condition for relocation with a symbol" 2019-07-10 18:58:05 +00:00
MCA
Object [Support] Move llvm::MemoryBuffer to sys::fs::file_t 2019-07-10 00:34:13 +00:00
ObjectYAML [AMDGPU] gfx908 target 2019-07-09 18:10:06 +00:00
Option
Passes Add a transform pass to make the executable semantics of poison explicit in the IR 2019-07-09 18:49:29 +00:00
ProfileData [Profile] Support raw/indexed profiles larger than 4GB 2019-07-09 22:01:04 +00:00
Remarks [Remarks] Add cl::Hidden to -remarks-yaml-string-table 2019-07-10 15:46:36 +00:00
Support [llvm-objcopy] Don't change permissions of non-regular output files 2019-07-11 10:17:59 +00:00
TableGen
Target [X86] -fno-plt: use GOT __tls_get_addr only if GOTPCRELX is enabled 2019-07-11 10:10:09 +00:00
Testing
TextAPI
ToolDrivers
Transforms NFC: Pass DataLayout into isBytewiseValue 2019-07-10 22:53:52 +00:00
WindowsManifest
XRay [Support] Move llvm::MemoryBuffer to sys::fs::file_t 2019-07-10 00:34:13 +00:00
CMakeLists.txt
LLVMBuild.txt