https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87551
Bug ID: 87551 Summary: [9 regression] libgnat-9.so fails to link on Solaris Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap Assignee: unassigned at gcc dot gnu.org Reporter: ro at gcc dot gnu.org CC: edlinger at gcc dot gnu.org Target Milestone: --- Host: i386-pc-solaris2.11, amd64-pc-solaris2.11, sparc*-sun-solaris2.11 Target: i386-pc-solaris2.11, amd64-pc-solaris2.11, sparc*-sun-solaris2.11 Build: i386-pc-solaris2.11, amd64-pc-solaris2.11, sparc*-sun-solaris2.11 Since this patch (r264850) 2018-10-04 Bernd Edlinger <bernd.edlin...@hotmail.de> * varasm.c (output_constant): Add new parameter merge_strings. Make strings properly zero terminated in merge string sections. (mergeable_string_section): Don't fail if the last char is non-zero. (assemble_variable_contents): Handle merge string sections. (assemble_variable): Likewise. (assemble_constant_contents): Likewise. (output_constant_def_contents): Likewise. (output_constructor_array_range, output_constructor_regular_field): Adjust call to output_constant. (output_object_block): Adjust call to assemble_constant_contents and assemble_variable_contents. libada tails to link on Solaris 11 with /bin/ld and gas (i.e. when string merging is supported). ld complains ld: fatal: relocation error: R_386_GOTOFF: file s-shasto.o: section [10].rel.text: symbol .LC8: symbol has been discarded with discarded section: [18].rodata.str1.1 ld: fatal: relocation error: R_386_GOTOFF: file s-shasto.o: section [10].rel.text: symbol .LC8: symbol has been discarded with discarded section: [18].rodata.str1.1 ld: fatal: relocation error: R_386_GOTOFF: file s-shasto.o: section [14].rel.text.unlikely: symbol .LC8: symbol has been discarded with discarded section: [18].rodata.str1.1 and indeed that section is empty Section Header[18]: sh_name: .rodata.str1.1 sh_addr: 0 sh_flags: [ SHF_ALLOC SHF_MERGE SHF_STRINGS ] sh_size: 0 sh_type: [ SHT_PROGBITS ] sh_offset: 0x1cb0 sh_entsize: 0x1 (0 entries) sh_link: 0 sh_info: 0 sh_addralign: 0x1 while relocations remain: [179] R_386_GOTOFF 0x106a 0 .text .LC8 [209] R_386_GOTOFF 0x1408 0 .text .LC8 [39] R_386_GOTOFF 0x28c 0 .text.unlikely .LC8 s-shasto.s has .section .rodata.str1.1,"aMS",@progbits,1 .LC8: .section .rodata .align 4 .LC1: .long 1 .long 0 (i.e. an empty .rodata.str1.1 section with label .LC8 in it) while before we had .section .rodata .LC8: .align 4 .LC1: .long 1 .long 0 (i.e. a non-empty .rodata section).