Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some symbols not found error for libc and libresolv wrapping #1591

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/wrapped/generated/functions_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3062,9 +3062,9 @@
#!defined(NOALIGN) iFEipiip
#!defined(STATICBUILD) iFlip
#!defined(STATICBUILD) iFLLi
#!defined(STATICBUILD) iFipup
#!defined(STATICBUILD) iFLLiW
#!defined(STATICBUILD) iFiipup
#!defined(STATICBUILD) iFEipup
#!defined(STATICBUILD) iFEiipup
#!defined(STATICBUILD) iFpipppL
#() vFEv -> vFE
#() iFEv -> iFE
Expand Down Expand Up @@ -4262,6 +4262,8 @@ wrappedlibc:
- __vdprintf_chk
- iFipii:
- epoll_wait
- iFipup:
- __xmknod
- iFippi:
- fstatat
- fstatat64
Expand Down Expand Up @@ -4298,6 +4300,8 @@ wrappedlibc:
- ptrace
- vFpLLpp:
- qsort_r
- iFiipup:
- __xmknodat
- iFiippi:
- __fxstatat
- __fxstatat64
Expand Down
4 changes: 4 additions & 0 deletions src/wrapped/generated/wrappedlibctypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ typedef int32_t (*iFiiiN_t)(int32_t, int32_t, int32_t, ...);
typedef int32_t (*iFiipV_t)(int32_t, int32_t, void*, ...);
typedef int32_t (*iFiipA_t)(int32_t, int32_t, void*, va_list);
typedef int32_t (*iFipii_t)(int32_t, void*, int32_t, int32_t);
typedef int32_t (*iFipup_t)(int32_t, void*, uint32_t, void*);
typedef int32_t (*iFippi_t)(int32_t, void*, void*, int32_t);
typedef int32_t (*iFippL_t)(int32_t, void*, void*, uintptr_t);
typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*);
Expand All @@ -79,6 +80,7 @@ typedef int32_t (*iFppiV_t)(void*, void*, int32_t, ...);
typedef int32_t (*iFpppp_t)(void*, void*, void*, void*);
typedef intptr_t (*lFuipp_t)(uint32_t, int32_t, void*, void*);
typedef void (*vFpLLpp_t)(void*, uintptr_t, uintptr_t, void*, void*);
typedef int32_t (*iFiipup_t)(int32_t, int32_t, void*, uint32_t, void*);
typedef int32_t (*iFiippi_t)(int32_t, int32_t, void*, void*, int32_t);
typedef int32_t (*iFiLLLL_t)(int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
typedef int32_t (*iFipiip_t)(int32_t, void*, int32_t, int32_t, void*);
Expand Down Expand Up @@ -247,6 +249,7 @@ typedef int32_t (*iFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void*
GO(__dprintf_chk, iFiipV_t) \
GO(__vdprintf_chk, iFiipA_t) \
GO(epoll_wait, iFipii_t) \
GO(__xmknod, iFipup_t) \
GO(fstatat, iFippi_t) \
GO(fstatat64, iFippi_t) \
GO(readlinkat, iFippL_t) \
Expand All @@ -271,6 +274,7 @@ typedef int32_t (*iFppipppp_t)(void*, void*, int32_t, void*, void*, void*, void*
GO(scandir64, iFpppp_t) \
GO(ptrace, lFuipp_t) \
GO(qsort_r, vFpLLpp_t) \
GO(__xmknodat, iFiipup_t) \
GO(__fxstatat, iFiippi_t) \
GO(__fxstatat64, iFiippi_t) \
GO(prctl, iFiLLLL_t) \
Expand Down
10 changes: 4 additions & 6 deletions src/wrapped/generated/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -3114,9 +3114,9 @@ typedef int32_t (*iFEipiip_t)(x64emu_t*, int32_t, void*, int32_t, int32_t, void*
#if !defined(STATICBUILD)
typedef int32_t (*iFlip_t)(intptr_t, int32_t, void*);
typedef int32_t (*iFLLi_t)(uintptr_t, uintptr_t, int32_t);
typedef int32_t (*iFipup_t)(int32_t, void*, uint32_t, void*);
typedef int32_t (*iFLLiW_t)(uintptr_t, uintptr_t, int32_t, uint16_t);
typedef int32_t (*iFiipup_t)(int32_t, int32_t, void*, uint32_t, void*);
typedef int32_t (*iFEipup_t)(x64emu_t*, int32_t, void*, uint32_t, void*);
typedef int32_t (*iFEiipup_t)(x64emu_t*, int32_t, int32_t, void*, uint32_t, void*);
typedef int32_t (*iFpipppL_t)(void*, int32_t, void*, void*, void*, uintptr_t);
#endif

Expand Down Expand Up @@ -6198,9 +6198,9 @@ void iFEipiip(x64emu_t *emu, uintptr_t fcn) { iFEipiip_t fn = (iFEipiip_t)fcn; R
#if !defined(STATICBUILD)
void iFlip(x64emu_t *emu, uintptr_t fcn) { iFlip_t fn = (iFlip_t)fcn; R_RAX=(int32_t)fn((intptr_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX); }
void iFLLi(x64emu_t *emu, uintptr_t fcn) { iFLLi_t fn = (iFLLi_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX); }
void iFipup(x64emu_t *emu, uintptr_t fcn) { iFipup_t fn = (iFipup_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); }
void iFLLiW(x64emu_t *emu, uintptr_t fcn) { iFLLiW_t fn = (iFLLiW_t)fcn; R_RAX=(int32_t)fn((uintptr_t)R_RDI, (uintptr_t)R_RSI, (int32_t)R_RDX, (uint16_t)R_RCX); }
void iFiipup(x64emu_t *emu, uintptr_t fcn) { iFiipup_t fn = (iFiipup_t)fcn; R_RAX=(int32_t)fn((int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); }
void iFEipup(x64emu_t *emu, uintptr_t fcn) { iFEipup_t fn = (iFEipup_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (void*)R_RSI, (uint32_t)R_RDX, (void*)R_RCX); }
void iFEiipup(x64emu_t *emu, uintptr_t fcn) { iFEiipup_t fn = (iFEiipup_t)fcn; R_RAX=(int32_t)fn(emu, (int32_t)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (void*)R_R8); }
void iFpipppL(x64emu_t *emu, uintptr_t fcn) { iFpipppL_t fn = (iFpipppL_t)fcn; R_RAX=(int32_t)fn((void*)R_RDI, (int32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (uintptr_t)R_R9); }
#endif

Expand Down Expand Up @@ -8040,9 +8040,7 @@ int isSimpleWrapper(wrapper_t fun) {
#if !defined(STATICBUILD)
if (fun == &iFlip) return 1;
if (fun == &iFLLi) return 1;
if (fun == &iFipup) return 1;
if (fun == &iFLLiW) return 1;
if (fun == &iFiipup) return 1;
if (fun == &iFpipppL) return 1;
#endif
return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/wrapped/generated/wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -3114,9 +3114,9 @@ void iFEipiip(x64emu_t *emu, uintptr_t fnc);
#if !defined(STATICBUILD)
void iFlip(x64emu_t *emu, uintptr_t fnc);
void iFLLi(x64emu_t *emu, uintptr_t fnc);
void iFipup(x64emu_t *emu, uintptr_t fnc);
void iFLLiW(x64emu_t *emu, uintptr_t fnc);
void iFiipup(x64emu_t *emu, uintptr_t fnc);
void iFEipup(x64emu_t *emu, uintptr_t fnc);
void iFEiipup(x64emu_t *emu, uintptr_t fnc);
void iFpipppL(x64emu_t *emu, uintptr_t fnc);
#endif

Expand Down
14 changes: 14 additions & 0 deletions src/wrapped/wrappedlibc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,20 @@ EXPORT int my___fxstat64(x64emu_t *emu, int vers, int fd, void* buf)
return r;
}

EXPORT int my___xmknod(x64emu_t* emu, int v, char* path, uint32_t mode, dev_t* dev)
{
(void)emu;
(void)v;
return mknod((const char*)path, mode, *dev);
}

EXPORT int my___xmknodat(x64emu_t* emu, int v, int dirfd, char* path, uint32_t mode, dev_t* dev)
{
(void)emu;
(void)v;
return mknodat(dirfd, (const char*)path, mode, *dev);
}

EXPORT int my___xstat(x64emu_t* emu, int v, void* path, void* buf)
{
(void)emu; (void)v;
Expand Down
4 changes: 2 additions & 2 deletions src/wrapped/wrappedlibc_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -2409,8 +2409,8 @@ GO(xdr_void, iFv)
//GO(__xmknod, iFipup)
//GO(__xmknodat, iFiipup)
#else
GO(__xmknod, iFipup)
GO(__xmknodat, iFiipup)
GOM(__xmknod, iFEipup)
GOM(__xmknodat, iFEiipup)
#endif
GO(__xpg_basename, pFp)
GOW(__xpg_sigpause, iFi)
Expand Down
6 changes: 3 additions & 3 deletions src/wrapped/wrappedlibresolv_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ GO(__res_nsearch, iFppiipi)
//DATA(_res_opcodes, 4)
GO(__res_ownok, iFp)
GO(__res_queriesmatch, iFpppp)
GO(__res_query, iFpiipi)
GO2(__res_query, iFpiipi, res_query)
GOW(res_query, iFpiipi)
GO(__res_querydomain, iFppiipi)
GO2(__res_querydomain, iFppiipi, res_querydomain)
GOW(res_querydomain, iFppiipi)
GO(__res_search, iFpiipi)
GO2(__res_search, iFpiipi, res_search)
GOW(res_search, iFpiipi)
GO(__res_send, iFpipi)
//GO(res_send_setqhook
Expand Down