Bug 17515 – ld.gold identical comdat folding triggers an assertion

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-06-16T19:24:23Z
Last change time
2024-12-13T18:52:41Z
Assigned to
No Owner
Creator
Martin Nowak
Moved to GitHub: dmd#19264 →

Comments

Comment #0 by code — 2017-06-16T19:24:23Z
ld -v cat > bug.d << CODE import std.stdio; void main() { writeln("Hello"); } CODE dmd bug.d -L--icf=safe ---- /usr/bin/ld: internal error in get_section_contents, at icf.cc:504 Fails at https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gold/icf.cc;h=a49ce2e960ffb6ac9764830f11145d045abba216#l504 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 https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gold/icf.cc;h=a49ce2e960ffb6ac9764830f11145d045abba216#l509 hints towards that. Not sure why dmd's .text sections take the `if ((secn_flags & elfcpp::SHF_STRINGS) != 0)` branch though.
Comment #1 by robert.schadek — 2024-12-13T18:52:41Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19264 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB