Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Felix Kopp
Ardix
Commits
c24b183c
Verified
Commit
c24b183c
authored
Aug 05, 2021
by
Felix Kopp
Browse files
init: fix init array pointer dereference bullshit
parent
6287cb79
Changes
2
Hide whitespace changes
Inline
Side-by-side
arch/at91sam3x8e/handle_reset.c
View file @
c24b183c
...
...
@@ -22,11 +22,11 @@ __naked __noreturn void handle_reset(void)
memmove
(
&
_srelocate
,
&
_etext
,
(
size_t
)(
&
_erelocate
)
-
(
size_t
)(
&
_srelocate
));
memset
(
&
_szero
,
0
,
(
size_t
)(
&
_ezero
)
-
(
size_t
)(
&
_szero
));
for
(
uint
32
_t
*
fn
=
&
__preinit_array_start
;
fn
!=
&
__preinit_array_end
;
fn
++
)
(
(
void
(
*
)(
void
))
fn
)();
for
(
uint
ptr
_t
*
fn
=
&
__preinit_array_start
;
fn
!=
&
__preinit_array_end
;
fn
++
)
(
(
void
(
*
)(
void
))
*
fn
)();
for
(
uint
32
_t
*
fn
=
&
__init_array_start
;
fn
!=
&
__init_array_end
;
fn
++
)
(
(
void
(
*
)(
void
))
fn
)();
for
(
uint
ptr
_t
*
fn
=
&
__init_array_start
;
fn
!=
&
__init_array_end
;
fn
++
)
(
(
void
(
*
)(
void
))
*
fn
)();
/* start the Kernel */
main
();
...
...
arch/at91sam3x8e/include/arch/linker.h
View file @
c24b183c
...
...
@@ -60,9 +60,9 @@ extern uintptr_t __preinit_array_end;
* standard C library. They are executed after the preinit array, so memory
* allocation is already available.
*/
extern
uint
32
_t
__init_array_start
;
extern
uint
ptr
_t
__init_array_start
;
/** @brief End of init array. */
extern
uint
32
_t
__init_array_end
;
extern
uint
ptr
_t
__init_array_end
;
/*
* This file is part of Ardix.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment