https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81926
--- Comment #38 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> --- > --- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> --- > Note that dwarf2out.c causes the section to be emitted via > > static void > dwarf2out_assembly_start (void) > { > #ifndef DWARF2_LINENO_DEBUGGING_INFO > ASM_GENERATE_INTERNAL_LABEL (text_section_label, TEXT_SECTION_LABEL, 0); > ASM_GENERATE_INTERNAL_LABEL (text_end_label, TEXT_END_LABEL, 0); > ASM_GENERATE_INTERNAL_LABEL (cold_text_section_label, > COLD_TEXT_SECTION_LABEL, 0); > ASM_GENERATE_INTERNAL_LABEL (cold_end_label, COLD_END_LABEL, 0); > > switch_to_section (text_section); > ASM_OUTPUT_LABEL (asm_out_file, text_section_label); > #endif > ... > > part of the code refering to the label is guarded by a text_section_used > flag btw., not sure if that works reliably enough but I guess it is > only properly initialized after the above. Thus the middle-end would > need to support sth like 'give me a label at the start of section FOO'. > > The easiest workaround is indeed to always emit .text (which indeed gas does). > And I'd rather do that where the assemby_start debug hook is called instead > of in target specific hooks. The newly attached patch does that and worked for me on sparc-sun-solaris2.11. I've left the assembly_start call in vmsdbgout.c (vmsdbgout_assembly_start) alone since I can neither test it nor does it seem affected: it's only called for VMS_AND_DWARF2_DEBUG which isn't problematic. Rainer