[llvm-bugs] [Bug 42082] New: Sets execute permissions but GNU objcopy does not
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu May 30 20:16:03 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=42082
Bug ID: 42082
Summary: Sets execute permissions but GNU objcopy does not
Product: tools
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: llvm-objcopy/strip
Assignee: unassignedbugs at nondot.org
Reporter: alexbrachetmialot at gmail.com
CC: alexander.v.shaposhnikov at gmail.com,
jake.h.ehrlich at gmail.com,
jh7370.2008 at my.bristol.ac.uk,
llvm-bugs at lists.llvm.org, rupprecht at google.com
llvm-objcopy writes files with all 3 execute bits set. This is not what GNU
objcopy does. Is this intended? This happens on line 39 of Buffer.cpp where we
create the FileOutputBuffer, if we just remove the F_executable flag we will
have the same behaviour as GNU objcopy.
$ llvm-objcopy --strip-symbol=func test.o no_func_llvm.o
$ objcopy --strip-symbol=func test.o no_func_gnu.o
$ ls -l
-rw-rw-r-- 1 abrachet abrachet 1648 May 30 22:38 no_func_gnu.o
-rwxrwxr-x 1 abrachet abrachet 1648 May 30 22:38 no_func_llvm.o
For reference:
$ objcopy --version
GNU objcopy (GNU Binutils for Ubuntu) 2.30
$ llvm-objcopy --version
llvm-objcopy, compatible with GNU objcopy
LLVM (http://llvm.org/):
LLVM version 9.0.0svn
DEBUG build with assertions.
Default target: x86_64-unknown-linux-gnu
Host CPU: skylake
$ file test.o
test.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190531/f33b44e0/attachment.html>
More information about the llvm-bugs
mailing list