cat > bug.d << CODE import std.stdio; void main() { writefln("Hello %1$s!", "World"); } CODE dmd -run bug ---- When debugging this gdb constantly barks that it can't find the function frames. In this specific program the format spec is incorrect. It seems that some data/code is corrupted when linking with gold. We should investigate whether this is an issue in dmd's codegen.
*** Issue 11492 has been marked as a duplicate of this issue. ***
I think the importance is higher than normal. It's not just not being able to debug, the produced executables can actually crash and do so if using std.concurrency. See this duplicate I filed: https://d.puremagic.com/issues/show_bug.cgi?id=11492
(In reply to comment #2) > I think the importance is higher than normal. I think so too, raised to critical. Seems like more people (distributions?) begin to use ld.gold. Probably due to reduced link times.
cat > bug.d << CODE enum Op { a, b, c, d, } void bug(Op op) { final switch (op) { case Op.a: case Op.b: case Op.c: case Op.d: } } void main() { bug(Op.a); } CODE There are an extra 8-bytes at the start of the switch table. Maybe an alignment issue?
https://github.com/D-Programming-Language/dmd/pull/2768
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/905d00af03efc9f8bbdb3d25e9776b0d0061783e fix Issue 11406 - ld.gold breaks switch table jumps - This is due to the fact that gold doesn't add target addends to relocations (only uses the 64-bit rela addend). https://github.com/D-Programming-Language/dmd/commit/854896cab40632cd3d2cd40d6461c62c36e6a79a Merge pull request #2768 from dawgfoto/fix11406 fix Issue 11406 - ld.gold breaks switch table jumps
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/774eb391bbf324a5ab064a19cc48e549719958b1 Merge pull request #2768 from dawgfoto/fix11406 fix Issue 11406 - ld.gold breaks switch table jumps