[llvm-bugs] [Bug 35739] New: compiler-rt: files contain writable and executable sections

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Dec 24 10:51:48 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35739

            Bug ID: 35739
           Summary: compiler-rt: files contain writable and executable
                    sections
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: willwiemann at fake-box.com
                CC: llvm-bugs at lists.llvm.org

My Linux system detected some writeable and executable sections in the files

usr/lib/clang/5.0.1/lib/linux/libclang_rt.builtins-x86_64.a:chkstk.S.o
usr/lib/clang/5.0.1/lib/linux/libclang_rt.builtins-x86_64.a:chkstk2.S.o
usr/lib/clang/5.0.1/lib/linux/libclang_rt.builtins-i386.a:chkstk.S.o
usr/lib/clang/5.0.1/lib/linux/libclang_rt.builtins-i386.a:chkstk2.S.o

I do not understand entirely why this is the case. However, I'm not alone with
this  (see related issues by other projects).

This is what I've found out so far.

The commit [1] fixed part of this but did not cover {i386,x86_64}/chkstk.S,
{i386,x86_64}/chkstk2.S. The reason might be that NO_EXEC_STACK_DIRECTIVE is a
NO-OP on Windows and according to the comments in the files chkstk.S and
chkstk2.S are windows only. This impression is supported by
lib/builtin/CMakeFiles.txt which explicitly includes these files as additional
x86_64_SOURCES (line 247).
However, these files are already included in x86_64_SOURCES (same for
i386_SOURCES). This was done by commit [2]. Looking at this commit more
closely, it  adds chkstk.S and chkstk2.S unconditionally even though they were
conditionally included. My guess is that these files were added accidentally by
[2] and should only be compiled on Windows.

[1]
git-sha: 4c71a477ac0bd7b19c72d7625861f1f18c15b278
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273500
91177308-0d34-0410-b5e6-96231b3b80d8

[2]
git-sha: a405fc16c3227898f22422a045ee2e36bc605776
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252927
91177308-0d34-0410-b5e6-96231b3b80d8

Related issues by other projects:

rust: https://github.com/rust-lang-nursery/compiler-builtins/issues/183
gentoo: https://bugs.gentoo.org/show_bug.cgi?id=641026

-- 
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/20171224/0aea4685/attachment.html>


More information about the llvm-bugs mailing list