[Bug ld/32264] For Windows,`.CRT` section should be merged into `.rdata`

2024-10-11 Thread lh_mouse at 126 dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32264 --- Comment #1 from LIU Hao --- The special case in LLD is here: (https://github.com/llvm/llvm-project/blob/ebeb56af5f8f1ff9da8f5a7e98348f460d223de1/lld/COFF/Writer.cpp#L1113-L1123) ```c++ if (name == ".CRT") { // In link.exe, there

[Bug ld/32264] For Windows,`.CRT` section should be merged into `.rdata`

2024-10-11 Thread lh_mouse at 126 dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32264 --- Comment #2 from LIU Hao --- And there's more; actually all these sections are merged into `.rdata`: (https://github.com/llvm/llvm-project/blob/ebeb56af5f8f1ff9da8f5a7e98348f460d223de1/lld/COFF/Driver.cpp#L2044-L2048) ``` if (config->min

[Bug ld/32260] regression: /bin/ld: BFD (GNU Binutils for Debian) 2.43.1 assertion fail ../../bfd/merge.c:247

2024-10-11 Thread jonny.weir at clearpool dot io
https://sourceware.org/bugzilla/show_bug.cgi?id=32260 --- Comment #4 from Jonny Weir --- (In reply to Alan Modra from comment #3) > Looks to me that merge.c:177 should be unsigned int newnb ... > By calculating newnb as unsigned long we get to a count of 2^32 and overflow > table->nbuckets withou

[Bug ld/32260] regression: /bin/ld: BFD (GNU Binutils for Debian) 2.43.1 assertion fail ../../bfd/merge.c:247

2024-10-11 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32260 --- Comment #5 from Alan Modra --- Yes, I see now that the error from sec_merge_maybe_resize is passed up to record_section and _bfd_merge_sections, but elflink.c:_bfd_elf_merge_sections ignores an error from _bfd_merge_sections. ldlang.c:lan