D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15392 - dmd object files fail to link with ld.gold
Summary: dmd object files fail to link with ld.gold
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 regression
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-01 02:23 UTC by Martin Nowak
Modified: 2016-01-04 20:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Martin Nowak 2015-12-01 02:23:38 UTC
Recent master versions of dmd trigger an ld.gold assertion.
/usr/bin/ld: internal error in add_output_section_to_load, at output.cc:4093

Seems like it complains about input section having a different order than the mapping in the linker script.
https://sourceware.org/git/?p=binutils.git;a=blob;f=gold/output.cc;hb=a0a1bb07cb2c03b7d34f12e734c6f363ddb7c7b2#l4135

Apparently caused by this PR.
https://github.com/D-Programming-Language/dmd/pull/5264

In my linker script .eh_frame follows .rodata but precedes .tdata.
Comment 1 Walter Bright 2015-12-01 03:46:00 UTC
The sections are not supposed to be order dependent.
Comment 2 Martin Nowak 2015-12-01 08:47:31 UTC
(In reply to Walter Bright from comment #1)
> The sections are not supposed to be order dependent.

Yeah, you're right, the problem is that ld.gold doesn't assign an output order to the eh section.
https://sourceware.org/git/?p=binutils.git;a=blob;f=gold/layout.cc;hb=a0a1bb07cb2c03b7d34f12e734c6f363ddb7c7b2#l1386
Comment 3 Martin Nowak 2016-01-04 20:52:53 UTC
I can no longer reproduce this, maybe I had some corrupted object file lying around. The linker wasn't updated since filing this bug report.