[llvm-bugs] [Bug 26915] New: Exception handling doesn't work when linked using binutils gold 2.21.1

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 11 10:06:25 PST 2016


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

            Bug ID: 26915
           Summary: Exception handling doesn't work when linked using
                    binutils gold 2.21.1
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: MC
          Assignee: unassignedbugs at nondot.org
          Reporter: sugak at fb.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

`try-catch` block in a code build with clang, and linked using gold (binutils
2.21.1), doesn't catches exceptions: 
Tested on 3.8 LLVM, and trunk:
LLVM git c1b22faefa9f470405e4d3bf3150eb694a0c439a
Clang git 612eea8a21b02346124f671b4fafd8bf064218ab

```
$ cat a.cpp
int main() {
  try {
    throw 42;
  } catch (...) {
  }
  return 0;
}

$ clang++ -B<path to binutils 2.21.1>/bin/gold -L<path to glibc 2.20>/lib a.cpp
$ ./a.out
terminate called after throwing an instance of 'int'
[Exit 134 (ABRT)]
```

Bisected to the following change in LLVM: git
20db4731726eded30dd7bcd6702a7e7498bf7b29 (corresponding Clang git
db7ff082d2dbfb035d6ef21a107727ae61bf1e46)

A quick search suggests that there was a bug in gold:
https://sourceware.org/ml/binutils/2011-06/msg00376.html

Not sure if this should be fixed in LLVM, but worth mentioning somewhere in
documentation.

-- 
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/20160311/9eea30da/attachment.html>


More information about the llvm-bugs mailing list