Skip to content
Snippets Groups Projects
Commit 1b10c3d2 authored by Ahmed Abd El Mawgood's avatar Ahmed Abd El Mawgood
Browse files

Prioterize search path instead of overwriting it.

Current LD_LIBRARY_PATH implementation overwrites the original search
path, which is not the best idea, instead this patch would check
LD_LIBRARY_PATH first and if it didn't find the libraries it is looking
for, then it will search the original search path
parent c7910a87
No related branches found
No related tags found
1 merge request!275Ld library path
...@@ -138,8 +138,8 @@ pub extern "C" fn relibc_ld_so_start(sp: &'static mut Stack, ld_entry: usize) -> ...@@ -138,8 +138,8 @@ pub extern "C" fn relibc_ld_so_start(sp: &'static mut Stack, ld_entry: usize) ->
// Some variables that will be overridden by environment and auxiliary vectors // Some variables that will be overridden by environment and auxiliary vectors
let library_path = match envs.get("LD_LIBRARY_PATH") { let library_path = match envs.get("LD_LIBRARY_PATH") {
Some(lib_path) => lib_path, Some(lib_path) => lib_path.to_owned() + ":/lib",
None => "/lib", None => "/lib".to_owned(),
}; };
let path = if is_manual { let path = if is_manual {
...@@ -178,7 +178,7 @@ pub extern "C" fn relibc_ld_so_start(sp: &'static mut Stack, ld_entry: usize) -> ...@@ -178,7 +178,7 @@ pub extern "C" fn relibc_ld_so_start(sp: &'static mut Stack, ld_entry: usize) ->
} }
pr pr
}; };
let mut linker = Linker::new(library_path, false); let mut linker = Linker::new(&library_path, false);
match linker.load(&path, &path) { match linker.load(&path, &path) {
Ok(()) => (), Ok(()) => (),
Err(err) => { Err(err) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment