https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70435
Felix Jones <fewix3000 at hotmail dot co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fewix3000 at hotmail dot co.uk --- Comment #6 from Felix Jones <fewix3000 at hotmail dot co.uk> --- Related bug 88061 Here's a demonstration of the issue with GCC trunk x86-64 on godbolt: https://godbolt.org/z/9GFWZR Minimal example for reproducing: > template <typename Type> > Type __attribute__( ( used, section( ".my_section" ) ) ) add_types( Type a, > Type b ) { > return a + b; > } > > int main( int argc, char * argv[] ) { > return test_class<int>( s_value<3> ).add( add_types( 1, 2 ) ); > } Current behaviour: add_types within section .text Desired behaviour: add_types within section .my_section Clang trunk demonstrates the desired behaviour: https://godbolt.org/z/t8FNe0