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
Container Registry
Model registry
Operate
Environments
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
redox-os
relibc
Commits
d5b63a85
Commit
d5b63a85
authored
4 years ago
by
no name
Committed by
Ahmed Abd El Mawgood
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Fix compilation on Redox by removing use of access in ld_so"
This reverts commit
d9bacaec
.
parent
c3ae8022
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!279
Ld library path
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ld_so/linker.rs
+15
-1
15 additions, 1 deletion
src/ld_so/linker.rs
src/ld_so/mod.rs
+6
-0
6 additions, 0 deletions
src/ld_so/mod.rs
with
21 additions
and
1 deletion
src/ld_so/linker.rs
+
15
−
1
View file @
d5b63a85
...
...
@@ -26,6 +26,7 @@ use crate::{
};
use
super
::{
access
,
debug
::{
RTLDDebug
,
RTLDState
,
_dl_debug_state
,
_r_debug
},
tcb
::{
Master
,
Tcb
},
PAGE_SIZE
,
...
...
@@ -163,7 +164,20 @@ impl Linker {
if
self
.verbose
{
println!
(
"check {}"
,
path
);
}
return
Ok
(
Some
(
self
.load_recursive
(
name
,
&
path
)
?
));
let
access
=
unsafe
{
let
path_c
=
CString
::
new
(
path
.as_bytes
())
.map_err
(|
err
|
{
Error
::
Malformed
(
format!
(
"invalid path '{}': {}"
,
path
,
err
))
})
?
;
// TODO: Use R_OK | X_OK
// We cannot use unix stdlib because errno is thead local variable
// and fs:[0] is not set yet.
access
(
path_c
.as_ptr
(),
unistd
::
F_OK
)
==
0
};
if
access
{
return
Ok
(
Some
(
self
.load_recursive
(
name
,
&
path
)
?
));
}
}
Err
(
Error
::
Malformed
(
format!
(
"failed to locate '{}'"
,
name
)))
...
...
This diff is collapsed.
Click to expand it.
src/ld_so/mod.rs
+
6
−
0
View file @
d5b63a85
...
...
@@ -79,6 +79,12 @@ pub fn static_init(sp: &'static Stack) {
}
}
// Wrapper over the systemcall, Do not use outside of ld_so
pub
unsafe
fn
access
(
path
:
*
const
c_char
,
mode
:
c_int
)
->
c_int
{
let
path
=
CStr
::
from_ptr
(
path
);
syscall!
(
ACCESS
,
(
path
)
.as_ptr
(),
mode
)
as
c_int
}
#[cfg(target_os
=
"linux"
)]
pub
unsafe
fn
init
(
sp
:
&
'static
Stack
)
{
let
mut
tp
=
0usize
;
...
...
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