File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -77,10 +77,31 @@ void __attribute__((__noreturn__, __naked__)) __reset_handler() {
7777 * @brief Default handler that locks the cpu.
7878 *
7979 */
80- void __default_handler () {
80+ void __attribute__(( noreturn )) __default_handler () {
8181 // do nothing and wait
8282 while (true) {}
8383}
8484
8585// called when a vft entry is not yet filled in
86- void __attribute__((weak )) __cxa_pure_virtual () {}
86+ void __attribute__((weak )) __cxa_pure_virtual () {}
87+
88+ // when optimization is off we need to provide these
89+ // functions for some standard library features. These
90+ // are just stubs that call the default handler. When
91+ // optimization is on these are not needed as they do
92+ // not do anything.
93+ #if __OPTIMIZATION_LEVEL__ == 0
94+ void __attribute__((weak )) _exit (int ) {
95+ __default_handler ();
96+ }
97+
98+ void __attribute__((weak )) _kill () {
99+ __default_handler ();
100+ }
101+
102+ int __attribute__((weak )) _getpid () {
103+ return 1 ;
104+ }
105+
106+ void __attribute__((weak )) _fini () {}
107+ #endif
You can’t perform that action at this time.
0 commit comments