@@ -69,6 +69,13 @@ __asm__(".pushsection .init,\"ax\",@progbits\n\t"
6969__asm__(".pushsection .init,\"ax\",@progbits\n\t"
7070 "call " __USER_LABEL_PREFIX__ "__do_init\n\t"
7171 ".popsection" );
72+ #elif defined(__xtensa__ )
73+ __asm__(".pushsection .init.literal,\"ax\",@progbits\n\t"
74+ ".popsection\n\t"
75+ ".pushsection .init,\"ax\",@progbits\n\t"
76+ "movi a8, __do_init\n\t"
77+ "callx8 a8\n\t"
78+ ".popsection" );
7279#else
7380#error "crtbegin without .init_fini array unimplemented for this architecture"
7481#endif // CRT_HAS_INITFINI_ARRAY
@@ -122,6 +129,13 @@ __asm__(".pushsection .fini,\"ax\",@progbits\n\t"
122129__asm__(".pushsection .fini,\"ax\",@progbits\n\t"
123130 "call " __USER_LABEL_PREFIX__ "__do_fini\n\t"
124131 ".popsection" );
132+ #elif defined(__xtensa__ )
133+ __asm__(".pushsection .fini.literal,\"ax\",@progbits\n\t"
134+ ".popsection\n\t"
135+ ".pushsection .fini,\"ax\",@progbits\n\t"
136+ "movi a8, __do_fini\n\t"
137+ "callx8 a8\n\t"
138+ ".popsection" );
125139#else
126140#error "crtbegin without .init_fini array unimplemented for this architecture"
127141#endif // CRT_HAS_INIT_FINI_ARRAY
0 commit comments