[llvm-bugs] [Bug 25079] New: -fsanitize=cfi-icall incompatible with functions with explicit sections

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 6 12:19:41 PDT 2015


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

            Bug ID: 25079
           Summary: -fsanitize=cfi-icall incompatible with functions with
                    explicit sections
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: peter at pcc.me.uk
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

$ cat sect.c
__attribute__((section("foo"))) int main() {
  int (*m)() = main;
  m();
}
$ ~/src/llvm-build-rel/bin/clang -fsanitize=cfi-icall -flto sect.c
-fuse-ld=gold
LLVM ERROR: Bit set element may not have an explicit section
clang-3.7: error: linker command failed with exit code 1 (use -v to see
invocation)

It should be easy to put the function body in the specified section, but doing
the same for the function pointer address will be more tricky as the icall
check relies on function pointer addresses being contiguous.

-- 
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/20151006/2b81f831/attachment.html>


More information about the llvm-bugs mailing list