Fix compilation with trace feature

This commit is contained in:
Jeremy Soller
2025-01-09 12:23:23 -07:00
parent 01d7f7b44a
commit 02520b194e
3 changed files with 6 additions and 11 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ pub unsafe extern "C" fn __tls_get_addr(ti: *mut dl_tls_index) -> *mut c_void {
ti.ti_module,
ti.ti_offset,
masters.len(),
tcb.dtv_mut().unwrap().len()
tcb.dtv_mut().len()
);
if tcb.dtv_mut().len() < masters.len() {
+1 -2
View File
@@ -420,7 +420,6 @@ impl DSO {
let mut dynamic = None;
for ph in elf.elf_program_headers() {
let voff = ph.p_vaddr(endian) % ph.p_align(endian);
// let vaddr = (ph.p_vaddr - voff) as usize;
let vsize = ((ph.p_memsz(endian) + voff) as usize)
.next_multiple_of(ph.p_align(endian) as usize);
@@ -456,7 +455,7 @@ impl DSO {
};
trace!(
" copy {:#x}, {:#x}: {:#x}, {:#x}",
vaddr,
ph.p_vaddr(endian) - voff,
vsize,
voff,
obj_data.len()
+4 -8
View File
@@ -106,18 +106,14 @@ macro_rules! trace_expr {
trace!("{}", format_args!($($arg)*));
#[allow(unused_unsafe)]
let trace_old_errno = unsafe { platform::errno };
#[allow(unused_unsafe)]
unsafe { platform::errno = 0; }
let trace_old_errno = platform::ERRNO.get();
platform::ERRNO.set(0);
let ret = $expr;
#[allow(unused_unsafe)]
let trace_errno = unsafe { platform::errno } as isize;
let trace_errno = platform::ERRNO.get() as isize;
if trace_errno == 0 {
#[allow(unused_unsafe)]
unsafe { platform::errno = trace_old_errno; }
platform::ERRNO.set(trace_old_errno);
}
let trace_strerror = if trace_errno >= 0 && trace_errno < STR_ERROR.len() as isize {