www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17515] New: ld.gold identical comdat folding triggers an


          Issue ID: 17515
           Summary: ld.gold identical comdat folding triggers an assertion
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

ld -v
cat > bug.d << CODE
import std.stdio;
void main() { writeln("Hello"); }
dmd bug.d -L--icf=safe
/usr/bin/ld: internal error in get_section_contents, at icf.cc:504

Fails at
for .text. sections because entsize == 0.

Guess this needs something similar to -ffunction-sections with each function
being in it's own section and entsize it's size. At least
hints towards that.

Not sure why dmd's .text sections take the `if ((secn_flags &
elfcpp::SHF_STRINGS) != 0)` branch though.

Jun 16 2017