Commit 6cf7fbe
authored
Couple of refactorings to make adding dynamic linker support easier (#111)
* Move the relocate call from init_runtime to entry
Self-relocation is not actually initializing runtime state, but making
it possible to safely run any code at all. When using a dynamic linker
the dynamic linker needs to be relocated before it can do dynamic
linking, but some of the runtime intialization needs to happen after
dynamic linking when all static DSO's that use thread local storage are
known.
* Always write thread_id field after initializing thread metadata
Also move writing __stack_chk_guard earlier. This makes future
refactorings easier.1 parent 6484717 commit 6cf7fbe
2 files changed
Lines changed: 22 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
93 | 100 | | |
94 | 101 | | |
95 | 102 | | |
| |||
187 | 194 | | |
188 | 195 | | |
189 | 196 | | |
190 | | - | |
191 | | - | |
| 197 | + | |
192 | 198 | | |
193 | 199 | | |
194 | 200 | | |
| |||
197 | 203 | | |
198 | 204 | | |
199 | 205 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 102 | + | |
109 | 103 | | |
110 | | - | |
| 104 | + | |
111 | 105 | | |
112 | 106 | | |
113 | 107 | | |
| |||
336 | 330 | | |
337 | 331 | | |
338 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | 393 | | |
402 | 394 | | |
403 | 395 | | |
| |||
408 | 400 | | |
409 | 401 | | |
410 | 402 | | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
| 403 | + | |
418 | 404 | | |
419 | 405 | | |
420 | 406 | | |
| |||
432 | 418 | | |
433 | 419 | | |
434 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
435 | 425 | | |
436 | 426 | | |
437 | 427 | | |
| |||
544 | 534 | | |
545 | 535 | | |
546 | 536 | | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
| 537 | + | |
554 | 538 | | |
555 | 539 | | |
556 | 540 | | |
| |||
0 commit comments