Skip to content

Commit 25b8eaf

Browse files
Removed calling preinit and init functions
Removed uncalled functions when running through j-link
1 parent 5a21cbe commit 25b8eaf

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

entry/entry.c

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,37 +37,9 @@ void __attribute__((__noreturn__, __naked__)) __reset_handler() {
3737
((volatile uint8_t*)(&__bss_start))[i] = 0x00;
3838
}
3939

40-
extern const entry_constructor __preinit_array_start;
41-
extern const entry_constructor __preinit_array_end;
42-
43-
// excecute all the preinit constructors
44-
for (uint32_t i = 0; i < (&__preinit_array_end - &__preinit_array_start); i++) {
45-
// call the preinit calls
46-
(&__preinit_array_start)[i]();
47-
}
48-
49-
extern const entry_constructor __init_array_start;
50-
extern const entry_constructor __init_array_end;
51-
52-
// excecute all the global constructors
53-
for (uint32_t i = 0; i < (&__init_array_end - &__init_array_start); i++) {
54-
// call every constructor we have
55-
(&__init_array_start)[i]();
56-
}
57-
5840
// run main
5941
(void)main();
6042

61-
extern const entry_constructor __fini_array_start;
62-
extern const entry_constructor __fini_array_end;
63-
64-
// run all the destructors. Should never be called but if it happens
65-
// it should work
66-
for (uint32_t i = 0; i < (&__fini_array_end - &__fini_array_start); i++) {
67-
// call every destructor we have
68-
(&__fini_array_start)[i]();
69-
}
70-
7143
// we should never be here. If this happens loop to make
7244
// sure we never exit the reset handler
7345
while (true) {};
@@ -83,4 +55,4 @@ void __default_handler() {
8355
}
8456

8557
// called when a vft entry is not yet filled in
86-
void __cxa_pure_virtual() {}
58+
void __cxa_pure_virtual() {}

0 commit comments

Comments
 (0)