[PATCH] D41041: [ELF] Don't set the executable bit for relocatable or shared files

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 03:44:52 PST 2017


grimar added a comment.

+1 to testcase request.



================
Comment at: ELF/Writer.cpp:1843
+                       ? FileOutputBuffer::F_executable
+                       : 0;
   Expected<std::unique_ptr<FileOutputBuffer>> BufferOrErr =
----------------
I believe LLD style avoids using ternary operator where possible.
So I see this code better as:
```
unsigned Flags = FileOutputBuffer::F_executable;
if (Config->Relocatable || Config->Shared)
  Flags = 0;

```


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D41041





More information about the llvm-commits mailing list