https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105169
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Richard Biener from comment #11) > (In reply to Richard Biener from comment #10) > > Btw, a good example might be how we handle .vtable_map_vars for VTV which > > uses handle_vtv_comdat_section instead of switch_to_section. It might have > > more specialities but then it should serve as a recipie how to handle > > non-ELF. > > So sth like the following would do the trick for ELF. But maybe better > abstract a switch_to_comdat_section and re-use that from the vtv handler > and this place to avoid touching in_section directly. switch_to_section already takes a 'decl' as argument but that's only used for some diagnostics. OTOH it's a bit odd to switch to the "same" __patchable_function_entries section but each time associate it with another decl. A nice API will ask for quite some bikeshedding I suppose. So maybe just handle_pfe_comdat_section ...