Commit bb8b8e84 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Andrei Vagin

compel: Remove criu's int.h from infect

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent f81d69da
...@@ -7,7 +7,6 @@ COMPEL_SO_VERSION_CODE := $(shell expr $(COMPEL_SO_VERSION_MAJOR) \* 65536 \+ $( ...@@ -7,7 +7,6 @@ COMPEL_SO_VERSION_CODE := $(shell expr $(COMPEL_SO_VERSION_MAJOR) \* 65536 \+ $(
ccflags-y += -iquote compel/arch/$(ARCH)/src/lib/include ccflags-y += -iquote compel/arch/$(ARCH)/src/lib/include
ccflags-y += -iquote compel/include ccflags-y += -iquote compel/include
ccflags-y += -iquote compel/plugins/include ccflags-y += -iquote compel/plugins/include
ccflags-y += -iquote $(SRC_DIR)/criu/include
ccflags-y += -fPIC ccflags-y += -fPIC
lib-y += arch/$(ARCH)/src/lib/handle-elf.o lib-y += arch/$(ARCH)/src/lib/handle-elf.o
......
...@@ -77,7 +77,7 @@ setrlimit 164 75 (int resource, struct krlimit *rlim) ...@@ -77,7 +77,7 @@ setrlimit 164 75 (int resource, struct krlimit *rlim)
mount 40 21 (char *dev_nmae, char *dir_name, char *type, unsigned long flags, void *data) mount 40 21 (char *dev_nmae, char *dir_name, char *type, unsigned long flags, void *data)
umount2 39 52 (char *name, int flags) umount2 39 52 (char *name, int flags)
gettid 178 224 (void) gettid 178 224 (void)
futex 98 240 (u32 *uaddr, int op, u32 val, struct timespec *utime, u32 *uaddr2, u32 val3) futex 98 240 (uint32_t *uaddr, int op, uint32_t val, struct timespec *utime, uint32_t *uaddr2, uint32_t val3)
set_tid_address 96 256 (int *tid_addr) set_tid_address 96 256 (int *tid_addr)
restart_syscall 128 0 (void) restart_syscall 128 0 (void)
timer_create 107 257 (clockid_t which_clock, struct sigevent *timer_event_spec, kernel_timer_t *created_timer_id) timer_create 107 257 (clockid_t which_clock, struct sigevent *timer_event_spec, kernel_timer_t *created_timer_id)
...@@ -94,7 +94,7 @@ rt_tgsigqueueinfo 240 363 (pid_t tgid, pid_t pid, int sig, siginfo_t *info) ...@@ -94,7 +94,7 @@ rt_tgsigqueueinfo 240 363 (pid_t tgid, pid_t pid, int sig, siginfo_t *info)
vmsplice 75 343 (int fd, const struct iovec *iov, unsigned long nr_segs, unsigned int flags) vmsplice 75 343 (int fd, const struct iovec *iov, unsigned long nr_segs, unsigned int flags)
timerfd_settime 86 353 (int ufd, int flags, const struct itimerspec *utmr, struct itimerspec *otmr) timerfd_settime 86 353 (int ufd, int flags, const struct itimerspec *utmr, struct itimerspec *otmr)
fanotify_init 262 367 (unsigned int flags, unsigned int event_f_flags) fanotify_init 262 367 (unsigned int flags, unsigned int event_f_flags)
fanotify_mark 263 368 (int fanotify_fd, unsigned int flags, u64 mask, int dfd, const char *pathname) fanotify_mark 263 368 (int fanotify_fd, unsigned int flags, uint64_t mask, int dfd, const char *pathname)
open_by_handle_at 265 371 (int mountdirfd, struct file_handle *handle, int flags) open_by_handle_at 265 371 (int mountdirfd, struct file_handle *handle, int flags)
setns 268 375 (int fd, int nstype) setns 268 375 (int fd, int nstype)
kcmp 272 378 (pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) kcmp 272 378 (pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2)
......
...@@ -74,7 +74,7 @@ __NR_setrlimit 75 sys_setrlimit (int resource, struct krlimit *rlim) ...@@ -74,7 +74,7 @@ __NR_setrlimit 75 sys_setrlimit (int resource, struct krlimit *rlim)
__NR_mount 21 sys_mount (char *dev_nmae, char *dir_name, char *type, unsigned long flags, void *data) __NR_mount 21 sys_mount (char *dev_nmae, char *dir_name, char *type, unsigned long flags, void *data)
__NR_umount2 52 sys_umount2 (char *name, int flags) __NR_umount2 52 sys_umount2 (char *name, int flags)
__NR_gettid 207 sys_gettid (void) __NR_gettid 207 sys_gettid (void)
__NR_futex 221 sys_futex (u32 *uaddr, int op, u32 val, struct timespec *utime, u32 *uaddr2, u32 val3) __NR_futex 221 sys_futex (uint32_t *uaddr, int op, uint32_t val, struct timespec *utime, uint32_t *uaddr2, uint32_t val3)
__NR_set_tid_address 232 sys_set_tid_address (int *tid_addr) __NR_set_tid_address 232 sys_set_tid_address (int *tid_addr)
__NR_restart_syscall 0 sys_restart_syscall (void) __NR_restart_syscall 0 sys_restart_syscall (void)
__NR_sys_timer_create 240 sys_timer_create (clockid_t which_clock, struct sigevent *timer_event_spec, kernel_timer_t *created_timer_id) __NR_sys_timer_create 240 sys_timer_create (clockid_t which_clock, struct sigevent *timer_event_spec, kernel_timer_t *created_timer_id)
...@@ -93,7 +93,7 @@ __NR_timerfd_settime 311 sys_timerfd_settime (int ufd, int flags, const struct ...@@ -93,7 +93,7 @@ __NR_timerfd_settime 311 sys_timerfd_settime (int ufd, int flags, const struct
__NR_signalfd4 313 sys_signalfd (int fd, k_rtsigset_t *mask, size_t sizemask, int flags) __NR_signalfd4 313 sys_signalfd (int fd, k_rtsigset_t *mask, size_t sizemask, int flags)
__NR_rt_tgsigqueueinfo 322 sys_rt_tgsigqueueinfo (pid_t tgid, pid_t pid, int sig, siginfo_t *info) __NR_rt_tgsigqueueinfo 322 sys_rt_tgsigqueueinfo (pid_t tgid, pid_t pid, int sig, siginfo_t *info)
__NR_fanotify_init 323 sys_fanotify_init (unsigned int flags, unsigned int event_f_flags) __NR_fanotify_init 323 sys_fanotify_init (unsigned int flags, unsigned int event_f_flags)
__NR_fanotify_mark 324 sys_fanotify_mark (int fanotify_fd, unsigned int flags, u64 mask, int dfd, const char *pathname) __NR_fanotify_mark 324 sys_fanotify_mark (int fanotify_fd, unsigned int flags, uint64_t mask, int dfd, const char *pathname)
__NR_open_by_handle_at 346 sys_open_by_handle_at (int mountdirfd, struct file_handle *handle, int flags) __NR_open_by_handle_at 346 sys_open_by_handle_at (int mountdirfd, struct file_handle *handle, int flags)
__NR_setns 350 sys_setns (int fd, int nstype) __NR_setns 350 sys_setns (int fd, int nstype)
__NR_kcmp 354 sys_kcmp (pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) __NR_kcmp 354 sys_kcmp (pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2)
......
...@@ -14,61 +14,61 @@ ...@@ -14,61 +14,61 @@
long sys_socket(int domain, int type, int protocol) long sys_socket(int domain, int type, int protocol)
{ {
u32 a[] = { (u32)domain, (u32)type, (u32)protocol }; uint32_t a[] = { (uint32_t)domain, (uint32_t)type, (uint32_t)protocol };
return sys_socketcall(SYS_SOCKET, (unsigned long *)a); return sys_socketcall(SYS_SOCKET, (unsigned long *)a);
} }
long sys_connect(int sockfd, struct sockaddr *addr, int addrlen) long sys_connect(int sockfd, struct sockaddr *addr, int addrlen)
{ {
u32 a[] = {(u32)sockfd, (u32)addr, (u32)addrlen}; uint32_t a[] = {(uint32_t)sockfd, (uint32_t)addr, (uint32_t)addrlen};
return sys_socketcall(SYS_CONNECT, (unsigned long *)a); return sys_socketcall(SYS_CONNECT, (unsigned long *)a);
} }
long sys_sendto(int sockfd, void *buff, size_t len, unsigned int flags, struct sockaddr *addr, int addr_len) long sys_sendto(int sockfd, void *buff, size_t len, unsigned int flags, struct sockaddr *addr, int addr_len)
{ {
u32 a[] = {(u32)sockfd, (u32)buff, (u32)len, (u32)flags, (u32)addr, (u32)addr_len}; uint32_t a[] = {(uint32_t)sockfd, (uint32_t)buff, (uint32_t)len, (uint32_t)flags, (uint32_t)addr, (uint32_t)addr_len};
return sys_socketcall(SYS_SENDTO, (unsigned long *)a); return sys_socketcall(SYS_SENDTO, (unsigned long *)a);
} }
long sys_recvfrom(int sockfd, void *ubuf, size_t size, unsigned int flags, struct sockaddr *addr, int *addr_len) long sys_recvfrom(int sockfd, void *ubuf, size_t size, unsigned int flags, struct sockaddr *addr, int *addr_len)
{ {
u32 a[] = {(u32)sockfd, (u32)ubuf, (u32)size, (u32)flags, (u32)addr, (u32)addr_len}; uint32_t a[] = {(uint32_t)sockfd, (uint32_t)ubuf, (uint32_t)size, (uint32_t)flags, (uint32_t)addr, (uint32_t)addr_len};
return sys_socketcall(SYS_RECVFROM, (unsigned long *)a); return sys_socketcall(SYS_RECVFROM, (unsigned long *)a);
} }
long sys_sendmsg(int sockfd, const struct msghdr *msg, int flags) long sys_sendmsg(int sockfd, const struct msghdr *msg, int flags)
{ {
u32 a[] = {(u32)sockfd, (u32)msg, (u32)flags}; uint32_t a[] = {(uint32_t)sockfd, (uint32_t)msg, (uint32_t)flags};
return sys_socketcall(SYS_SENDMSG, (unsigned long *)a); return sys_socketcall(SYS_SENDMSG, (unsigned long *)a);
} }
long sys_recvmsg(int sockfd, struct msghdr *msg, int flags) long sys_recvmsg(int sockfd, struct msghdr *msg, int flags)
{ {
u32 a[] = {(u32)sockfd, (u32)msg, (u32)flags}; uint32_t a[] = {(uint32_t)sockfd, (uint32_t)msg, (uint32_t)flags};
return sys_socketcall(SYS_RECVMSG, (unsigned long *)a); return sys_socketcall(SYS_RECVMSG, (unsigned long *)a);
} }
long sys_shutdown(int sockfd, int how) long sys_shutdown(int sockfd, int how)
{ {
u32 a[] = {(u32)sockfd, (u32)how}; uint32_t a[] = {(uint32_t)sockfd, (uint32_t)how};
return sys_socketcall(SYS_SHUTDOWN, (unsigned long *)a); return sys_socketcall(SYS_SHUTDOWN, (unsigned long *)a);
} }
long sys_bind(int sockfd, const struct sockaddr *addr, int addrlen) long sys_bind(int sockfd, const struct sockaddr *addr, int addrlen)
{ {
u32 a[] = {(u32)sockfd, (u32)addr, (u32)addrlen}; uint32_t a[] = {(uint32_t)sockfd, (uint32_t)addr, (uint32_t)addrlen};
return sys_socketcall(SYS_BIND, (unsigned long *)a); return sys_socketcall(SYS_BIND, (unsigned long *)a);
} }
long sys_setsockopt(int sockfd, int level, int optname, const void *optval, unsigned int optlen) long sys_setsockopt(int sockfd, int level, int optname, const void *optval, unsigned int optlen)
{ {
u32 a[] = {(u32)sockfd, (u32)level, (u32)optname, (u32)optval, (u32)optlen}; uint32_t a[] = {(uint32_t)sockfd, (uint32_t)level, (uint32_t)optname, (uint32_t)optval, (uint32_t)optlen};
return sys_socketcall(SYS_SETSOCKOPT, (unsigned long *)a); return sys_socketcall(SYS_SETSOCKOPT, (unsigned long *)a);
} }
long sys_getsockopt(int sockfd, int level, int optname, const void *optval, unsigned int *optlen) long sys_getsockopt(int sockfd, int level, int optname, const void *optval, unsigned int *optlen)
{ {
u32 a[] = {(u32)sockfd, (u32)level, (u32)optname, (u32)optval, (u32)optlen}; uint32_t a[] = {(uint32_t)sockfd, (uint32_t)level, (uint32_t)optname, (uint32_t)optval, (uint32_t)optlen};
return sys_socketcall(SYS_GETSOCKOPT, (unsigned long *)a); return sys_socketcall(SYS_GETSOCKOPT, (unsigned long *)a);
} }
...@@ -79,7 +79,7 @@ long sys_shmat(int shmid, void *shmaddr, int shmflag) ...@@ -79,7 +79,7 @@ long sys_shmat(int shmid, void *shmaddr, int shmflag)
return sys_ipc(SHMAT, shmid, shmflag, 0, shmaddr, 0); return sys_ipc(SHMAT, shmid, shmflag, 0, shmaddr, 0);
} }
long sys_pread(unsigned int fd, char *ubuf, u32 count, u64 pos) long sys_pread(unsigned int fd, char *ubuf, uint32_t count, uint64_t pos)
{ {
return sys_pread64(fd, ubuf, count, (u32)(pos & 0xffffffffu), (u32)(pos >> 32)); return sys_pread64(fd, ubuf, count, (uint32_t)(pos & 0xffffffffu), (uint32_t)(pos >> 32));
} }
...@@ -11,7 +11,7 @@ __NR_write 4 sys_write (int fd, const void *buf, unsigned long count) ...@@ -11,7 +11,7 @@ __NR_write 4 sys_write (int fd, const void *buf, unsigned long count)
__NR_open 5 sys_open (const char *filename, int flags, unsigned int mode) __NR_open 5 sys_open (const char *filename, int flags, unsigned int mode)
__NR_close 6 sys_close (int fd) __NR_close 6 sys_close (int fd)
__NR_unlink 10 sys_unlink (char *pathname) __NR_unlink 10 sys_unlink (char *pathname)
__NR_lseek 19 sys_lseek (int fd, s32 offset, unsigned int origin) __NR_lseek 19 sys_lseek (int fd, int32_t offset, unsigned int origin)
__NR_getpid 20 sys_getpid (void) __NR_getpid 20 sys_getpid (void)
__NR_mount 21 sys_mount (const char *dev_name, const char *dir_name, const char *type, unsigned long flags, const void *data) __NR_mount 21 sys_mount (const char *dev_name, const char *dir_name, const char *type, unsigned long flags, const void *data)
__NR_ptrace 26 sys_ptrace (long request, pid_t pid, void *addr, void *data) __NR_ptrace 26 sys_ptrace (long request, pid_t pid, void *addr, void *data)
...@@ -46,7 +46,7 @@ __NR_rt_sigreturn 173 sys_rt_sigreturn (void) ...@@ -46,7 +46,7 @@ __NR_rt_sigreturn 173 sys_rt_sigreturn (void)
__NR_rt_sigaction 174 sys_sigaction (int signum, const rt_sigaction_t *act, rt_sigaction_t *oldact, size_t sigsetsize) __NR_rt_sigaction 174 sys_sigaction (int signum, const rt_sigaction_t *act, rt_sigaction_t *oldact, size_t sigsetsize)
__NR_rt_sigprocmask 175 sys_sigprocmask (int how, k_rtsigset_t *set, k_rtsigset_t *oset, size_t sigsetsize) __NR_rt_sigprocmask 175 sys_sigprocmask (int how, k_rtsigset_t *set, k_rtsigset_t *oset, size_t sigsetsize)
__NR_rt_sigqueueinfo 178 sys_rt_sigqueueinfo (pid_t pid, int sig, siginfo_t *uinfo) __NR_rt_sigqueueinfo 178 sys_rt_sigqueueinfo (pid_t pid, int sig, siginfo_t *uinfo)
__NR_pread64 180 sys_pread64 (unsigned int fd, char *ubuf, u32 count, u32 poslo, u32 poshi) __NR_pread64 180 sys_pread64 (unsigned int fd, char *ubuf, uint32_t count, uint32_t poslo, uint32_t poshi)
__NR_capget 184 sys_capget (struct cap_header *h, struct cap_data *d) __NR_capget 184 sys_capget (struct cap_header *h, struct cap_data *d)
__NR_capset 185 sys_capset (struct cap_header *h, struct cap_data *d) __NR_capset 185 sys_capset (struct cap_header *h, struct cap_data *d)
__NR_sigaltstack 186 sys_sigaltstack (const void *uss_ptr, void *uoss_ptr) __NR_sigaltstack 186 sys_sigaltstack (const void *uss_ptr, void *uoss_ptr)
...@@ -62,7 +62,7 @@ __NR_setfsgid32 216 sys_setfsgid (int fsgid) ...@@ -62,7 +62,7 @@ __NR_setfsgid32 216 sys_setfsgid (int fsgid)
__NR_mincore 218 sys_mincore (void *addr, unsigned long size, unsigned char *vec) __NR_mincore 218 sys_mincore (void *addr, unsigned long size, unsigned char *vec)
__NR_madvise 219 sys_madvise (unsigned long start, size_t len, int behavior) __NR_madvise 219 sys_madvise (unsigned long start, size_t len, int behavior)
__NR_gettid 224 sys_gettid (void) __NR_gettid 224 sys_gettid (void)
__NR_futex 240 sys_futex (u32 *uaddr, int op, u32 val, struct timespec *utime, u32 *uaddr2, u32 val3) __NR_futex 240 sys_futex (uint32_t *uaddr, int op, uint32_t val, struct timespec *utime, uint32_t *uaddr2, uint32_t val3)
__NR_set_thread_area 243 sys_set_thread_area (user_desc_t *info) __NR_set_thread_area 243 sys_set_thread_area (user_desc_t *info)
__NR_get_thread_area 244 sys_get_thread_area (user_desc_t *info) __NR_get_thread_area 244 sys_get_thread_area (user_desc_t *info)
__NR_io_setup 245 sys_io_setup (unsigned nr_reqs, aio_context_t *ctx32p) __NR_io_setup 245 sys_io_setup (unsigned nr_reqs, aio_context_t *ctx32p)
...@@ -86,7 +86,7 @@ __NR_signalfd 321 sys_signalfd (int ufd, const k_rtsigset_t *sigmask, size_t ...@@ -86,7 +86,7 @@ __NR_signalfd 321 sys_signalfd (int ufd, const k_rtsigset_t *sigmask, size_t
__NR_timerfd_settime 325 sys_timerfd_settime (int ufd, int flags, const struct itimerspec *utmr, struct itimerspec *otmr) __NR_timerfd_settime 325 sys_timerfd_settime (int ufd, int flags, const struct itimerspec *utmr, struct itimerspec *otmr)
__NR_rt_tgsigqueueinfo 335 sys_rt_tgsigqueueinfo (pid_t tgid, pid_t pid, int sig, siginfo_t *uinfo) __NR_rt_tgsigqueueinfo 335 sys_rt_tgsigqueueinfo (pid_t tgid, pid_t pid, int sig, siginfo_t *uinfo)
__NR_fanotify_init 338 sys_fanotify_init (unsigned int flags, unsigned int event_f_flags) __NR_fanotify_init 338 sys_fanotify_init (unsigned int flags, unsigned int event_f_flags)
__NR_fanotify_mark 339 sys_fanotify_mark (int fanotify_fd, unsigned int flag, u32 mask, int dfd, const char *pathname) __NR_fanotify_mark 339 sys_fanotify_mark (int fanotify_fd, unsigned int flag, uint32_t mask, int dfd, const char *pathname)
__NR_open_by_handle_at 342 sys_open_by_handle_at (int mountdirfd, struct file_handle *handle, int flags) __NR_open_by_handle_at 342 sys_open_by_handle_at (int mountdirfd, struct file_handle *handle, int flags)
__NR_setns 346 sys_setns (int fd, int nstype) __NR_setns 346 sys_setns (int fd, int nstype)
__NR_kcmp 349 sys_kcmp (pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) __NR_kcmp 349 sys_kcmp (pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2)
......
...@@ -72,7 +72,7 @@ __NR_setrlimit 160 sys_setrlimit (int resource, struct krlimit *rlim) ...@@ -72,7 +72,7 @@ __NR_setrlimit 160 sys_setrlimit (int resource, struct krlimit *rlim)
__NR_mount 165 sys_mount (char *dev_nmae, char *dir_name, char *type, unsigned long flags, void *data) __NR_mount 165 sys_mount (char *dev_nmae, char *dir_name, char *type, unsigned long flags, void *data)
__NR_umount2 166 sys_umount2 (char *name, int flags) __NR_umount2 166 sys_umount2 (char *name, int flags)
__NR_gettid 186 sys_gettid (void) __NR_gettid 186 sys_gettid (void)
__NR_futex 202 sys_futex (u32 *uaddr, int op, u32 val, struct timespec *utime, u32 *uaddr2, u32 val3) __NR_futex 202 sys_futex (uint32_t *uaddr, int op, uint32_t val, struct timespec *utime, uint32_t *uaddr2, uint32_t val3)
__NR_set_thread_area 205 sys_set_thread_area (user_desc_t *info) __NR_set_thread_area 205 sys_set_thread_area (user_desc_t *info)
__NR_io_setup 206 sys_io_setup (unsigned nr_events, aio_context_t *ctx) __NR_io_setup 206 sys_io_setup (unsigned nr_events, aio_context_t *ctx)
__NR_io_getevents 208 sys_io_getevents (aio_context_t ctx, long min_nr, long nr, struct io_event *evs, struct timespec *tmo) __NR_io_getevents 208 sys_io_getevents (aio_context_t ctx, long min_nr, long nr, struct io_event *evs, struct timespec *tmo)
...@@ -98,7 +98,7 @@ __NR_timerfd_settime 286 sys_timerfd_settime (int ufd, int flags, const struct ...@@ -98,7 +98,7 @@ __NR_timerfd_settime 286 sys_timerfd_settime (int ufd, int flags, const struct
__NR_signalfd4 289 sys_signalfd (int fd, k_rtsigset_t *mask, size_t sizemask, int flags) __NR_signalfd4 289 sys_signalfd (int fd, k_rtsigset_t *mask, size_t sizemask, int flags)
__NR_rt_tgsigqueueinfo 297 sys_rt_tgsigqueueinfo (pid_t tgid, pid_t pid, int sig, siginfo_t *info) __NR_rt_tgsigqueueinfo 297 sys_rt_tgsigqueueinfo (pid_t tgid, pid_t pid, int sig, siginfo_t *info)
__NR_fanotify_init 300 sys_fanotify_init (unsigned int flags, unsigned int event_f_flags) __NR_fanotify_init 300 sys_fanotify_init (unsigned int flags, unsigned int event_f_flags)
__NR_fanotify_mark 301 sys_fanotify_mark (int fanotify_fd, unsigned int flags, u64 mask, int dfd, const char *pathname) __NR_fanotify_mark 301 sys_fanotify_mark (int fanotify_fd, unsigned int flags, uint64_t mask, int dfd, const char *pathname)
__NR_open_by_handle_at 304 sys_open_by_handle_at (int mountdirfd, struct file_handle *handle, int flags) __NR_open_by_handle_at 304 sys_open_by_handle_at (int mountdirfd, struct file_handle *handle, int flags)
__NR_setns 308 sys_setns (int fd, int nstype) __NR_setns 308 sys_setns (int fd, int nstype)
__NR_kcmp 312 sys_kcmp (pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) __NR_kcmp 312 sys_kcmp (pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2)
......
../../criu/include/asm-generic/int.h
\ No newline at end of file
...@@ -10,21 +10,20 @@ ...@@ -10,21 +10,20 @@
#include <sys/time.h> #include <sys/time.h>
#include <stdbool.h> #include <stdbool.h>
#include <signal.h> #include <signal.h>
#include <stdint.h>
#include <sched.h> #include <sched.h>
#include <fcntl.h> #include <fcntl.h>
#include <time.h> #include <time.h>
#include "int.h"
struct cap_header { struct cap_header {
u32 version; uint32_t version;
int pid; int pid;
}; };
struct cap_data { struct cap_data {
u32 eff; uint32_t eff;
u32 prm; uint32_t prm;
u32 inh; uint32_t inh;
}; };
struct robust_list_head; struct robust_list_head;
......
#include <sys/types.h> #include <sys/types.h>
#include "int.h"
#include "uapi/plugins.h" #include "uapi/plugins.h"
#include "uapi/plugin-std.h" #include "uapi/plugin-std.h"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <unistd.h> #include <unistd.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <stdint.h>
#include <fcntl.h> #include <fcntl.h>
...@@ -13,8 +14,6 @@ ...@@ -13,8 +14,6 @@
#include "uapi/compel.h" #include "uapi/compel.h"
#include "asm-generic/int.h"
#include "handle-elf.h" #include "handle-elf.h"
#include "piegen.h" #include "piegen.h"
...@@ -147,7 +146,7 @@ int __handle_elf(void *mem, size_t size) ...@@ -147,7 +146,7 @@ int __handle_elf(void *mem, size_t size)
size_t i, k, nr_gotpcrel = 0; size_t i, k, nr_gotpcrel = 0;
#ifdef ELF_PPC64 #ifdef ELF_PPC64
s64 toc_offset = 0; int64_t toc_offset = 0;
#endif #endif
int ret = -EINVAL; int ret = -EINVAL;
...@@ -284,8 +283,8 @@ int __handle_elf(void *mem, size_t size) ...@@ -284,8 +283,8 @@ int __handle_elf(void *mem, size_t size)
(unsigned)sh->sh_info, &secstrings[sh->sh_name]); (unsigned)sh->sh_info, &secstrings[sh->sh_name]);
for (k = 0; k < sh->sh_size / sh->sh_entsize; k++) { for (k = 0; k < sh->sh_size / sh->sh_entsize; k++) {
s64 __maybe_unused addend64, __maybe_unused value64; int64_t __maybe_unused addend64, __maybe_unused value64;
s32 __maybe_unused addend32, __maybe_unused value32; int32_t __maybe_unused addend32, __maybe_unused value32;
unsigned long place; unsigned long place;
const char *name; const char *name;
void *where; void *where;
...@@ -331,11 +330,11 @@ int __handle_elf(void *mem, size_t size) ...@@ -331,11 +330,11 @@ int __handle_elf(void *mem, size_t size)
} }
if (sh->sh_type == SHT_REL) { if (sh->sh_type == SHT_REL) {
addend32 = *(s32 *)where; addend32 = *(int32_t *)where;
addend64 = *(s64 *)where; addend64 = *(int64_t *)where;
} else { } else {
addend32 = (s32)r->rela.r_addend; addend32 = (int32_t)r->rela.r_addend;
addend64 = (s64)r->rela.r_addend; addend64 = (int64_t)r->rela.r_addend;
} }
place = sh_rel->sh_addr + r->rel.r_offset; place = sh_rel->sh_addr + r->rel.r_offset;
...@@ -344,8 +343,8 @@ int __handle_elf(void *mem, size_t size) ...@@ -344,8 +343,8 @@ int __handle_elf(void *mem, size_t size)
(unsigned long)sym->st_value, addend32, (long)addend64, (long)place, name); (unsigned long)sym->st_value, addend32, (long)addend64, (long)place, name);
if (sym->st_shndx == SHN_ABS) { if (sym->st_shndx == SHN_ABS) {
value32 = (s32)sym->st_value; value32 = (int32_t)sym->st_value;
value64 = (s64)sym->st_value; value64 = (int64_t)sym->st_value;
} else { } else {
Elf_Shdr *sh_src; Elf_Shdr *sh_src;
...@@ -357,8 +356,8 @@ int __handle_elf(void *mem, size_t size) ...@@ -357,8 +356,8 @@ int __handle_elf(void *mem, size_t size)
sh_src = sec_hdrs[sym->st_shndx]; sh_src = sec_hdrs[sym->st_shndx];
ptr_func_exit(sh_src); ptr_func_exit(sh_src);
value32 = (s32)sh_src->sh_addr + (s32)sym->st_value; value32 = (int32_t)sh_src->sh_addr + (int32_t)sym->st_value;
value64 = (s64)sh_src->sh_addr + (s64)sym->st_value; value64 = (int64_t)sh_src->sh_addr + (int64_t)sym->st_value;
} }
#ifdef ELF_PPC64 #ifdef ELF_PPC64
...@@ -499,18 +498,18 @@ int __handle_elf(void *mem, size_t size) ...@@ -499,18 +498,18 @@ int __handle_elf(void *mem, size_t size)
(unsigned int)place, (long)addend64, (long)value64); (unsigned int)place, (long)addend64, (long)value64);
break; break;
case R_X86_64_PC32: /* Symbol + Addend - Place (4 bytes) */ case R_X86_64_PC32: /* Symbol + Addend - Place (4 bytes) */
pr_debug("\t\t\t\tR_X86_64_PC32 at 0x%-4lx val 0x%x\n", place, value32 + addend32 - (s32)place); pr_debug("\t\t\t\tR_X86_64_PC32 at 0x%-4lx val 0x%x\n", place, value32 + addend32 - (int32_t)place);
/* /*
* R_X86_64_PC32 are relative, patch them inplace. * R_X86_64_PC32 are relative, patch them inplace.
*/ */
*((s32 *)where) = value32 + addend32 - place; *((int32_t *)where) = value32 + addend32 - place;
break; break;
case R_X86_64_PLT32: /* ProcLinkage + Addend - Place (4 bytes) */ case R_X86_64_PLT32: /* ProcLinkage + Addend - Place (4 bytes) */
pr_debug("\t\t\t\tR_X86_64_PLT32 at 0x%-4lx val 0x%x\n", place, value32 + addend32 - (s32)place); pr_debug("\t\t\t\tR_X86_64_PLT32 at 0x%-4lx val 0x%x\n", place, value32 + addend32 - (int32_t)place);
/* /*
* R_X86_64_PLT32 are relative, patch them inplace. * R_X86_64_PLT32 are relative, patch them inplace.
*/ */
*((s32 *)where) = value32 + addend32 - place; *((int32_t *)where) = value32 + addend32 - place;
break; break;
case R_X86_64_GOTPCREL: /* SymbolOffsetInGot + GOT + Addend - Place (4 bytes) */ case R_X86_64_GOTPCREL: /* SymbolOffsetInGot + GOT + Addend - Place (4 bytes) */
pr_debug("\t\t\t\tR_X86_64_GOTPCREL at 0x%-4lx val 0x%x\n", place, value32); pr_debug("\t\t\t\tR_X86_64_GOTPCREL at 0x%-4lx val 0x%x\n", place, value32);
...@@ -529,11 +528,11 @@ int __handle_elf(void *mem, size_t size) ...@@ -529,11 +528,11 @@ int __handle_elf(void *mem, size_t size)
(unsigned int)place, addend32, value32); (unsigned int)place, addend32, value32);
break; break;
case R_386_PC32: /* Symbol + Addend - Place */ case R_386_PC32: /* Symbol + Addend - Place */
pr_debug("\t\t\t\tR_386_PC32 at 0x%-4lx val 0x%x\n", place, value32 + addend32 - (s32)place); pr_debug("\t\t\t\tR_386_PC32 at 0x%-4lx val 0x%x\n", place, value32 + addend32 - (int32_t)place);
/* /*
* R_386_PC32 are relative, patch them inplace. * R_386_PC32 are relative, patch them inplace.
*/ */
*((s32 *)where) = value32 + addend32 - place; *((int32_t *)where) = value32 + addend32 - place;
break; break;
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment