Commit d574e07
committed
kernel: Unify .ctors and .init_array handling
Handle both of these sections in a single chunk of code instead of
separately. We don't need to use the legacy .ctors ABI as both
the constructors array and startup logic are managed within a single
link result.
This can now also be used with ARC MWDT which had been using the .ctors
sections but with .init_array semantics. For ARC MWDT, we now always
discard .dtors and .fini sections as Zephyr will never cause global
destructors to execute. Stop discarding .eh_frame sections so that
exception handling works as expected.
When building a NATIVE_APPLICATION, we ask the native C library to run all
of the constructors to ensure any non-Zephyr constructors are run before
main is invoked. It might be "nice" to split the constructors so that the
Zephyr constructors were executed by the Zephyr code while the non-Zephyr
ones were executed by the native C library. I think that could be done if
we knew the pathnames of either the Zephyr or non-Zephyr files. That might
make a good future enhancement.
Signed-off-by: Keith Packard <[email protected]>1 parent 5c00d99 commit d574e07
File tree
6 files changed
+73
-169
lines changed- include/zephyr
- arch/arc/v2
- linker/common-rom
- kernel
6 files changed
+73
-169
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | 145 | | |
153 | 146 | | |
154 | 147 | | |
| |||
311 | 304 | | |
312 | 305 | | |
313 | 306 | | |
314 | | - | |
| 307 | + | |
315 | 308 | | |
316 | 309 | | |
317 | | - | |
318 | | - | |
319 | 310 | | |
320 | 311 | | |
321 | 312 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
20 | 35 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 36 | | |
| 37 | + | |
27 | 38 | | |
28 | | - | |
29 | 39 | | |
30 | | - | |
31 | 40 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 41 | | |
38 | | - | |
39 | 42 | | |
40 | | - | |
41 | 43 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
56 | 52 | | |
57 | 53 | | |
58 | | - | |
59 | | - | |
60 | | - | |
| 54 | + | |
| 55 | + | |
61 | 56 | | |
62 | 57 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
73 | 62 | | |
74 | | - | |
75 | | - | |
76 | 63 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
977 | 977 | | |
978 | 978 | | |
979 | 979 | | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
984 | 984 | | |
985 | 985 | | |
986 | 986 | | |
| |||
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
1000 | | - | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
1001 | 998 | | |
1002 | 999 | | |
1003 | 1000 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
491 | 507 | | |
492 | 508 | | |
493 | 509 | | |
| |||
529 | 545 | | |
530 | 546 | | |
531 | 547 | | |
532 | | - | |
533 | | - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
534 | 551 | | |
535 | 552 | | |
536 | 553 | | |
| |||
This file was deleted.
0 commit comments