Skip to content

Commit

Permalink
c18n: Add dummy arguments to _rtld_unw_* to be compatible with libunwind
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgao authored and dstolfa committed Mar 26, 2024
1 parent a90316a commit 3eb7e56
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions libexec/rtld-elf/rtld_c18n.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,9 @@ unwind_stack(struct jmp_args ret, void *rcsp, struct trusted_frame *target,
}

struct jmp_args _rtld_longjmp(struct jmp_args, void *, void **);
struct jmp_args _rtld_unw_setcontext(struct jmp_args, void *, void **);
struct jmp_args _rtld_unw_setcontext_unsealed(struct jmp_args, void *, void **);
struct jmp_args _rtld_unw_setcontext(struct jmp_args, void *, void *, void **);
struct jmp_args _rtld_unw_setcontext_unsealed(struct jmp_args, void *, void *,
void **);

struct jmp_args
_rtld_longjmp(struct jmp_args ret, void *rcsp, void **buf)
Expand All @@ -859,14 +860,16 @@ _rtld_longjmp(struct jmp_args ret, void *rcsp, void **buf)
}

struct jmp_args
_rtld_unw_setcontext(struct jmp_args ret, void *rcsp, void **buf)
_rtld_unw_setcontext(struct jmp_args ret, void *p __unused, void *rcsp,
void **buf)
{
return (unwind_stack(ret, rcsp, cheri_unseal(*buf, sealer_unwbuf),
get_trusted_frame()));
}

struct jmp_args
_rtld_unw_setcontext_unsealed(struct jmp_args ret, void *rcsp, void **buf)
_rtld_unw_setcontext_unsealed(struct jmp_args ret, void *p __unused, void *rcsp,
void **buf)
{
return (unwind_stack(ret, rcsp, *buf, get_trusted_frame()));
}
Expand Down

0 comments on commit 3eb7e56

Please sign in to comment.