November 14, 2014
https://issues.dlang.org/show_bug.cgi?id=13733

          Issue ID: 13733
           Summary: DMD produce object file that cause gold to crash
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody@puremagic.com
          Reporter: deadalnix@gmail.com

>From a test to make C++ and D talk to each others:

D side:
import std.stdio;

extern (C++) void CallFromCPlusPlusTest() {
 writeln("You can call me from C++");
}

C++ side:
#include <iostream>

using namespace std;

void CallFromCPlusPlusTest();

int main() {
 cout << "hello world"<<"\n";
 CallFromCPlusPlusTest();
}

flags used for DMD: -g -debug -w

Linking the 2 objects files with gold produce the following error: bin/gold/ld: internal error in make_view, at fileread.cc:395 collect2: error: ld returned 1 exit status

I suspect this is a gold bug rather than a dmd bug, but as the problem do not manifest with gcc and/or clang, I doubt we get much traction on their side.

The version of gold used is "GNU gold (GNU Binutils 2.21.1) 1.11"

--