Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tornax O7
relibc
Commits
ae115ac6
Verified
Commit
ae115ac6
authored
6 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Run pre-init array before _init
parent
e764fedb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/start.rs
+16
-10
16 additions, 10 deletions
src/start.rs
with
16 additions
and
10 deletions
src/start.rs
+
16
−
10
View file @
ae115ac6
...
...
@@ -77,19 +77,25 @@ pub unsafe extern "C" fn relibc_start(sp: &'static Stack) -> ! {
stdio
::
stdout
=
stdio
::
default_stdout
.get
();
stdio
::
stderr
=
stdio
::
default_stderr
.get
();
// Run preinit array
{
let
mut
f
=
&
__preinit_array_start
as
*
const
_
;
while
f
<
&
__preinit_array_end
{
(
*
f
)();
f
=
f
.offset
(
1
);
}
}
// Call init section
_init
();
// Look for the neighbor functions in memory until the end
let
mut
f
=
&
__preinit_array_start
as
*
const
_
;
while
f
<
&
__preinit_array_end
{
(
*
f
)();
f
=
f
.offset
(
1
);
}
f
=
&
__init_array_start
as
*
const
_
;
while
f
<
&
__init_array_end
{
(
*
f
)();
f
=
f
.offset
(
1
);
// Run init array
{
let
mut
f
=
&
__init_array_start
as
*
const
_
;
while
f
<
&
__init_array_end
{
(
*
f
)();
f
=
f
.offset
(
1
);
}
}
// not argv or envp, because programs like bash try to modify this *const* pointer :|
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment