Merge branch 'weak-symbols' into 'master'

Weak symbols

See merge request redox-os/relibc!260
This commit is contained in:
Jeremy Soller
2020-03-19 17:56:22 +00:00
5 changed files with 96 additions and 43 deletions
+3 -3
View File
@@ -108,9 +108,9 @@ pub unsafe extern "C" fn dlsym(handle: *mut c_void, symbol: *const c_char) -> *m
eprintln!("dlsym: linker_ptr: {:p}", tcb.linker_ptr);
let linker = (&*tcb.linker_ptr).lock();
if let Some(global) = linker.globals.get(symbol_str) {
eprintln!("dlsym({:p}, {}) = 0x{:x}", handle, symbol_str, *global);
*global as *mut c_void
if let Some(global) = linker.get_sym(symbol_str) {
eprintln!("dlsym({:p}, {}) = 0x{:x}", handle, symbol_str, global);
global as *mut c_void
} else {
eprintln!("dlsym: symbol not found");
ERROR.store(ERROR_NOT_SUPPORTED.as_ptr() as usize, Ordering::SeqCst);
+2 -1
View File
@@ -5,7 +5,8 @@ use core::{convert::TryFrom, mem, ptr, slice};
use crate::{
c_str::CStr,
header::{
errno, fcntl, limits, stdlib::getenv, sys_ioctl, sys_time, sys_utsname, termios, time::timespec,
errno, fcntl, limits, stdlib::getenv, sys_ioctl, sys_time, sys_utsname, termios,
time::timespec,
},
platform::{self, types::*, Pal, Sys},
};