devel/valgrind: Remove unneeded patches

PR:		254917
Reported by:	ice@extreme.hu
This commit is contained in:
Paul Floyd 2021-04-10 23:37:20 +08:00 committed by Li-Wen Hsu
parent c37395fe14
commit ee96b39b9f
No known key found for this signature in database
GPG key ID: 8D7BCC7D012FD37E
10 changed files with 0 additions and 672 deletions

View file

@ -1,56 +0,0 @@
# HG changeset patch
# User Bitbucket <noreply@bitbucket.org>
# Date 0 0
# Node ID af5523fe25247f537884116bd37e8ce171ba837e
# Parent ce1acb28953fd6928ccb8f9511e374eab66e8625
# Parent 22cf2727f838e9f5efaeba377341c3807d74dbdb
Merge preview of source (22cf2727f838e9f5efaeba377341c3807d74dbdb) to destination (ce1acb28953fd6928ccb8f9511e374eab66e8625).
diff -r ce1acb28953fd6928ccb8f9511e374eab66e8625 -r af5523fe25247f537884116bd37e8ce171ba837e coregrind/m_syswrap/syswrap-freebsd.c
--- a/coregrind/m_syswrap/syswrap-freebsd.c
+++ b/coregrind/m_syswrap/syswrap-freebsd.c
@@ -480,6 +480,23 @@
SET_STATUS_from_SysRes(r);
}
+PRE(sys_accept4)
+{
+ *flags |= SfMayBlock;
+ PRINT("sys_accept4 ( %ld, %#lx, %ld, %ld)",ARG1,ARG2,ARG3,ARG4);
+ PRE_REG_READ4(long, "accept4",
+ int, s, struct sockaddr *, addr, int, *addrlen, int, flags);
+ ML_(generic_PRE_sys_accept)(tid, ARG1,ARG2,ARG3);
+}
+POST(sys_accept4)
+{
+ SysRes r;
+ vg_assert(SUCCESS);
+ r = ML_(generic_POST_sys_accept)(tid, VG_(mk_SysRes_Success)(RES),
+ ARG1,ARG2,ARG3);
+ SET_STATUS_from_SysRes(r);
+}
+
PRE(sys_sendto)
{
*flags |= SfMayBlock;
@@ -4307,7 +4324,8 @@
BSDXY(__NR___semctl, sys___semctl), // 510
BSDXY(__NR_shmctl, sys_shmctl), // 512
-
+
+ BSDXY(__NR_accept4, sys_accept4), //541
BSDXY(__NR_pipe2, sys_pipe2), // 542
BSDX_(__NR_fake_sigreturn, sys_fake_sigreturn), // 1000, fake sigreturn
diff -r ce1acb28953fd6928ccb8f9511e374eab66e8625 -r af5523fe25247f537884116bd37e8ce171ba837e include/vki/vki-scnums-freebsd.h
--- a/include/vki/vki-scnums-freebsd.h
+++ b/include/vki/vki-scnums-freebsd.h
@@ -407,6 +407,7 @@
#define __NR_posix_openpt 504
#define __NR___semctl 510
#define __NR_shmctl 512
+#define __NR_accept4 541
#define __NR_pipe2 542
#define __NR_fake_sigreturn 1000

View file

@ -1,239 +0,0 @@
From 6aaeefab2490d56743ec49d0e20d3fd6ff45fb55 Mon Sep 17 00:00:00 2001
From: Roman Bogorodskiy <bogorodskiy@gmail.com>
Date: Sat, 9 Sep 2017 18:27:15 +0400
Subject: [PATCH v2] ino64 support
---
coregrind/m_syswrap/priv_syswrap-freebsd.h | 4 ++
coregrind/m_syswrap/syswrap-freebsd.c | 65 ++++++++++++++++++++++
include/vki/vki-freebsd.h | 54 ++++++++++++++++++
include/vki/vki-scnums-freebsd.h | 4 ++
4 files changed, 127 insertions(+)
diff --git a/coregrind/m_syswrap/priv_syswrap-freebsd.h b/coregrind/m_syswrap/priv_syswrap-freebsd.h
index 63d122f..715ad48 100644
--- a/coregrind/m_syswrap/priv_syswrap-freebsd.h
+++ b/coregrind/m_syswrap/priv_syswrap-freebsd.h
@@ -97,10 +97,12 @@ DECL_TEMPLATE(freebsd, sys_setegid);
DECL_TEMPLATE(freebsd, sys_seteuid);
DECL_TEMPLATE(freebsd, sys_stat);
DECL_TEMPLATE(freebsd, sys_fstat);
+DECL_TEMPLATE(freebsd, sys_fstat64);
DECL_TEMPLATE(freebsd, sys_lstat);
DECL_TEMPLATE(freebsd, sys_pathconf);
DECL_TEMPLATE(freebsd, sys_fpathconf);
DECL_TEMPLATE(freebsd, sys_getdirentries);
+DECL_TEMPLATE(freebsd, sys_getdirentries64);
DECL_TEMPLATE(freebsd, sys_mmap);
DECL_TEMPLATE(freebsd, sys___syscall);
DECL_TEMPLATE(freebsd, sys_lseek);
@@ -208,6 +210,7 @@ DECL_TEMPLATE(freebsd, sys_kevent);
DECL_TEMPLATE(freebsd, sys_sendfile);
DECL_TEMPLATE(freebsd, sys_statfs6);
DECL_TEMPLATE(freebsd, sys_fstatfs6);
+DECL_TEMPLATE(freebsd, sys_fstatfs64);
DECL_TEMPLATE(freebsd, sys_fhstatfs6);
DECL_TEMPLATE(freebsd, sys_thr_exit);
DECL_TEMPLATE(freebsd, sys_thr_self);
@@ -251,6 +254,7 @@ DECL_TEMPLATE(freebsd, sys_fchmodat);
DECL_TEMPLATE(freebsd, sys_fchownat);
DECL_TEMPLATE(freebsd, sys_fexecve);
DECL_TEMPLATE(freebsd, sys_fstatat);
+DECL_TEMPLATE(freebsd, sys_fstatat64);
DECL_TEMPLATE(freebsd, sys_futimesat);
DECL_TEMPLATE(freebsd, sys_linkat);
DECL_TEMPLATE(freebsd, sys_mkdirat);
diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c
index bf6b1f1..978e98e 100644
--- a/coregrind/m_syswrap/syswrap-freebsd.c
+++ b/coregrind/m_syswrap/syswrap-freebsd.c
@@ -885,6 +885,18 @@ POST(sys_fstat)
POST_MEM_WRITE( ARG2, sizeof(struct vki_stat) );
}
+PRE(sys_fstat64)
+{
+ PRINT("sys_fstat64 ( %ld, %#lx )", ARG1, ARG2);
+ PRE_REG_READ2(long, "fstat", unsigned long, fd, struct stat64 *, buf);
+ PRE_MEM_WRITE( "fstat(buf)", ARG2, sizeof(struct vki_stat64) );
+}
+
+POST(sys_fstat64)
+{
+ POST_MEM_WRITE( ARG2, sizeof(struct vki_stat64) );
+}
+
PRE(sys_pathconf)
{
PRINT("sys_pathconf ( %#lx(%s), %ld )",ARG1,(char *)ARG1,ARG2);
@@ -1029,6 +1041,26 @@ POST(sys_getdirentries)
}
}
+PRE(sys_getdirentries64)
+{
+ *flags |= SfMayBlock;
+ PRINT("sys_getdents ( %ld, %#lx, %ld )", ARG1,ARG2,ARG3);
+ PRE_REG_READ3(vki_ssize_t, "getdirentries",
+ unsigned int, fd, struct dirent *, dirp,
+ vki_size_t, count);
+ PRE_MEM_WRITE( "getdirentries(dirp)", ARG2, ARG3 );
+}
+
+POST(sys_getdirentries64)
+{
+ vg_assert(SUCCESS);
+ if (RES > 0) {
+ POST_MEM_WRITE( ARG2, RES );
+ if ( ARG4 != 0 )
+ POST_MEM_WRITE( ARG4, sizeof (vki_off_t));
+ }
+}
+
PRE(sys_seteuid)
{
PRINT("sys_seteuid ( %ld )", ARG1);
@@ -1251,6 +1283,19 @@ POST(sys_fstatfs6)
POST_MEM_WRITE( ARG2, sizeof(struct vki_statfs6) );
}
+PRE(sys_fstatfs64)
+{
+ PRINT("sys_fstatfs64 ( %ld, %#lx )", ARG1, ARG2);
+ PRE_REG_READ2(long, "fstatfs6",
+ unsigned int, fd, struct statfs *, buf);
+ PRE_MEM_WRITE( "fstatfs6(buf)", ARG2, sizeof(struct vki_statfs64) );
+}
+
+POST(sys_fstatfs64)
+{
+ POST_MEM_WRITE( ARG2, sizeof(struct vki_statfs64) );
+}
+
PRE(sys_statfs6)
{
PRINT("sys_statfs6 ( %#lx(%s), %#lx )",ARG1,(char *)ARG1,ARG2);
@@ -3132,6 +3177,20 @@ POST(sys_fstatat)
POST_MEM_WRITE( ARG3, sizeof(struct vki_stat) );
}
+PRE(sys_fstatat64)
+{
+ PRINT("sys_fstatat ( %ld, %#lx(%s), %#lx )", ARG1,ARG2,(char*)ARG2,ARG3);
+ PRE_REG_READ3(long, "fstatat",
+ int, dfd, char *, file_name, struct stat *, buf);
+ PRE_MEM_RASCIIZ( "fstatat(file_name)", ARG2 );
+ PRE_MEM_WRITE( "fstatat(buf)", ARG3, sizeof(struct vki_stat) );
+}
+
+POST(sys_fstatat64)
+{
+ POST_MEM_WRITE( ARG3, sizeof(struct vki_stat) );
+}
+
PRE(sys_unlinkat)
{
*flags |= SfMayBlock;
@@ -4427,6 +4486,12 @@ const SyscallTableEntry ML_(syscall_table)[] = {
BSDXY(__NR_accept4, sys_accept4), //541
BSDXY(__NR_pipe2, sys_pipe2), // 542
+ // ino64
+ BSDXY(__NR_fstat64, sys_fstat64), // 551
+ BSDXY(__NR_fstatat64, sys_fstatat64), // 552
+ BSDXY(__NR_getdirentries64, sys_getdirentries64), // 554
+ GENXY(__NR_fstatfs64, sys_fstatfs), // 556
+
BSDX_(__NR_fake_sigreturn, sys_fake_sigreturn), // 1000, fake sigreturn
};
diff --git a/include/vki/vki-freebsd.h b/include/vki/vki-freebsd.h
index aee453e..318a207 100644
--- a/include/vki/vki-freebsd.h
+++ b/include/vki/vki-freebsd.h
@@ -367,6 +367,36 @@ struct vki_stat {
unsigned int :(8 / 2) * (16 - (int)sizeof(struct vki_timespec));
};
+struct vki_stat64 {
+ vki_uint64_t st_dev;
+ vki_uint64_t st_ino;
+ vki_uint64_t st_nlink;
+ vki_mode_t st_mode;
+ vki_int16_t st_padding0;
+ vki_uid_t st_uid;
+ vki_gid_t st_gid;
+ vki_int32_t st_padding1;
+ vki_uint64_t st_rdev;
+#if 0
+ struct vki_timespec st_atimespec;
+ struct vki_timespec st_mtimespec;
+ struct vki_timespec st_ctimespec;
+#else
+ vki_time_t st_atime;
+ long st_atime_nsec;
+ vki_time_t st_mtime;
+ long st_mtime_nsec;
+ vki_time_t st_ctime;
+ long st_ctime_nsec;
+#endif
+ struct vki_timespec st_birthtim;
+ vki_off_t st_size;
+ vki_blkcnt_t st_blocks;
+ vki_blksize_t st_blksize;
+ vki_fflags_t st_flags;
+ vki_uint64_t st_gen;
+ vki_int64_t st_spare[10];
+};
//----------------------------------------------------------------------
// From linux-2.6.8.1/include/linux/sched.h
@@ -941,6 +971,30 @@ struct vki_statfs {
char f_mntonname[VKI_MNAMELEN];
};
+struct vki_statfs64 {
+ vki_uint32_t f_version;
+ vki_uint32_t f_type;
+ vki_uint64_t f_flags;
+ vki_uint64_t f_bsize;
+ vki_uint64_t f_iosize;
+ vki_uint64_t f_blocks;
+ vki_uint64_t f_bfree;
+ vki_int64_t f_bavail;
+ vki_uint64_t f_files;
+ vki_int64_t f_ffree;
+ vki_uint64_t f_syncwrites;
+ vki_uint64_t f_asyncwrites;
+ vki_uint64_t f_syncreads;
+ vki_uint64_t f_asyncreads;
+ vki_uint64_t f_spare[10];
+ vki_uint32_t f_namemax;
+ vki_uid_t f_owner;
+ vki_fsid_t f_fsid;
+ char f_charspare[80];
+ char f_fstypename[VKI_MFSNAMELEN];
+ char f_mntfromnname[VKI_MNAMELEN];
+ char f_mntonname[VKI_MNAMELEN];
+};
#define MAXFIDSZ 16
struct vki_fid {
diff --git a/include/vki/vki-scnums-freebsd.h b/include/vki/vki-scnums-freebsd.h
index 605a42f..ffa241d 100644
--- a/include/vki/vki-scnums-freebsd.h
+++ b/include/vki/vki-scnums-freebsd.h
@@ -412,6 +412,10 @@
#define __NR_shmctl 512
#define __NR_accept4 541
#define __NR_pipe2 542
+#define __NR_fstat64 551
+#define __NR_fstatat64 552
+#define __NR_getdirentries64 554
+#define __NR_fstatfs64 556
#define __NR_fake_sigreturn 1000
--
2.14.1

View file

@ -1,87 +0,0 @@
# HG changeset patch
# User Bitbucket <noreply@bitbucket.org>
# Date 0 0
# Node ID 90c6097540f35e312d34340b916296130003c851
# Parent ce1acb28953fd6928ccb8f9511e374eab66e8625
# Parent 5662e704b72c7ebb116f8478a4ff3847acc72fc6
Merge preview of source (5662e704b72c7ebb116f8478a4ff3847acc72fc6) to destination (ce1acb28953fd6928ccb8f9511e374eab66e8625).
diff -r ce1acb28953fd6928ccb8f9511e374eab66e8625 -r 90c6097540f35e312d34340b916296130003c851 coregrind/m_syswrap/syswrap-freebsd.c
--- a/coregrind/m_syswrap/syswrap-freebsd.c
+++ b/coregrind/m_syswrap/syswrap-freebsd.c
@@ -3670,6 +3670,42 @@
POST_MEM_WRITE( ARG5, ARG4 );
}
+PRE(sys_jail_get)
+{
+
+ PRINT("sys_jail_get ( %#lx, %lu, %ld )", ARG1, ARG2, ARG3);
+ PRE_REG_READ3(int, "jail_get", struct vki_iovec *, iov, unsigned int,
+ niov, int, flags);
+ PRE_MEM_WRITE("jail_get", ARG1, ARG2 * sizeof(struct vki_iovec));
+}
+
+POST(sys_jail_get)
+{
+ vg_assert(SUCCESS);
+ if (RES != -1)
+ POST_MEM_WRITE(ARG1, ARG2);
+}
+
+PRE(sys_jail_set)
+{
+ PRINT("sys_jail_set ( %#lx, %lu, %ld )", ARG1, ARG2, ARG3);
+ PRE_REG_READ3(int, "jail_set", struct vki_iovec *, iov, unsigned int,
+ niov, int, flags);
+ PRE_MEM_WRITE("jail_set", ARG1, ARG2 * sizeof(struct vki_iovec));
+}
+
+PRE(sys_jail_attach)
+{
+ PRINT("sys_jail_attach ( %ld )", ARG1);
+ PRE_REG_READ1(int, "jail_attach", int, jid);
+}
+
+PRE(sys_jail_remove)
+{
+ PRINT("sys_jail_remove ( %ld )", ARG1);
+ PRE_REG_READ1(int, "jail_remove", int, jid);
+}
+
#undef PRE
#undef POST
@@ -4219,7 +4255,7 @@
BSDXY(__NR__umtx_lock, sys__umtx_lock), // 434
BSDXY(__NR__umtx_unlock, sys__umtx_unlock), // 435
- // jail_attach 436
+ BSDX_(__NR_jail_attach, sys_jail_attach), // 436
// extattr_list_fd 437
// extattr_list_file 438
// extattr_list_link 439
@@ -4303,6 +4339,10 @@
BSDX_(__NR_symlinkat, sys_symlinkat), // 502
BSDX_(__NR_unlinkat, sys_unlinkat), // 503
+ BSDXY(__NR_jail_get, sys_jail_get), // 506
+ BSDX_(__NR_jail_set, sys_jail_set), // 507
+ BSDX_(__NR_jail_remove, sys_jail_remove), // 508
+
// posix_openpt 504
BSDXY(__NR___semctl, sys___semctl), // 510
diff -r ce1acb28953fd6928ccb8f9511e374eab66e8625 -r 90c6097540f35e312d34340b916296130003c851 include/vki/vki-scnums-freebsd.h
--- a/include/vki/vki-scnums-freebsd.h
+++ b/include/vki/vki-scnums-freebsd.h
@@ -405,6 +405,9 @@
#define __NR_symlinkat 502
#define __NR_unlinkat 503
#define __NR_posix_openpt 504
+#define __NR_jail_get 506
+#define __NR_jail_set 507
+#define __NR_jail_remove 508
#define __NR___semctl 510
#define __NR_shmctl 512
#define __NR_pipe2 542

View file

@ -1,127 +0,0 @@
# HG changeset patch
# User Bitbucket <noreply@bitbucket.org>
# Date 0 0
# Node ID 7ecd33d57049211e1084fc5e8bf588da49088d75
# Parent ce1acb28953fd6928ccb8f9511e374eab66e8625
# Parent 79bf8f58bec842a1aa94f4fff2e4884a6bb5378b
Merge preview of source (79bf8f58bec842a1aa94f4fff2e4884a6bb5378b) to destination (ce1acb28953fd6928ccb8f9511e374eab66e8625).
diff -r ce1acb28953fd6928ccb8f9511e374eab66e8625 -r 7ecd33d57049211e1084fc5e8bf588da49088d75 coregrind/m_syswrap/syswrap-freebsd.c
--- a/coregrind/m_syswrap/syswrap-freebsd.c
+++ b/coregrind/m_syswrap/syswrap-freebsd.c
@@ -1246,6 +1246,52 @@
POST_MEM_WRITE( ARG2, sizeof(struct vki_statfs6) );
}
+/* ---------------------------------------------------------------------
+ kld* wrappers
+ ------------------------------------------------------------------ */
+
+PRE(sys_kldload)
+{
+ PRINT("sys_kldload ( %#lx(%s) )", ARG1, (char *)ARG1);
+ PRE_REG_READ1(int, "kldload", const char *, "file");
+
+ PRE_MEM_RASCIIZ( "kldload(file)", ARG1 );
+}
+
+PRE(sys_kldunload)
+{
+ PRINT("sys_kldunload ( %ld )", ARG1);
+ PRE_REG_READ1(int, "kldunload", int, "fileid");
+}
+
+PRE(sys_kldfind)
+{
+ PRINT("sys_kldfind ( %#lx(%s) )", ARG1, (char *)ARG1);
+ PRE_REG_READ1(int, "kldfind", const char *, "file");
+
+ PRE_MEM_RASCIIZ( "kldfind(file)", ARG1 );
+}
+
+PRE(sys_kldnext)
+{
+ PRINT("sys_kldnext ( %ld )", ARG1);
+ PRE_REG_READ1(int, "kldnext", int, "fileid");
+}
+
+PRE(sys_kldsym)
+{
+ PRINT("sys_kldsym ( %ld, %ld, %#lx )", ARG1,ARG2,ARG3 );
+ PRE_REG_READ3(int, "kldsym", int, "fileid", int, "command", void*, "data");
+ PRE_MEM_READ( "kldsym(data)", ARG3, sizeof(struct vki_kld_sym_lookup) );
+ struct vki_kld_sym_lookup *kslp = (struct vki_kld_sym_lookup *)ARG3;
+ PRE_MEM_RASCIIZ( "kldsym(data.symname)", (Addr)kslp->symname );
+}
+POST(sys_kldsym)
+{
+ struct vki_kld_sym_lookup *kslp = (struct vki_kld_sym_lookup *)ARG3;
+ POST_MEM_WRITE( (Addr)&kslp->symvalue, sizeof(kslp->symvalue) );
+ POST_MEM_WRITE( (Addr)&kslp->symsize, sizeof(kslp->symsize) );
+}
#if 0
/* ---------------------------------------------------------------------
@@ -3389,14 +3435,14 @@
moans--;
VG_(message)(Vg_UserMsg,
"Warning: noted but unhandled ioctl 0x%lx"
- " with no size/direction hints",
+ " with no size/direction hints\n",
ARG2);
VG_(message)(Vg_UserMsg,
" This could cause spurious value errors"
- " to appear.");
+ " to appear.\n");
VG_(message)(Vg_UserMsg,
" See README_MISSING_SYSCALL_OR_IOCTL for "
- "guidance on writing a proper wrapper." );
+ "guidance on writing a proper wrapper.\n" );
}
} else {
if ((dir & _VKI_IOC_WRITE) && size > 0)
@@ -4054,10 +4100,10 @@
// BSDX_(__NR_modfnext, sys_modfnext), // 302
BSDX_(__NR_modfind, sys_modfind), // 303
-// BSDX_(__NR_kldload, sys_kldload), // 304
-// BSDX_(__NR_kldunload, sys_kldunload), // 305
-// BSDX_(__NR_kldfind, sys_kldfind), // 306
-// BSDX_(__NR_kldnext, sys_kldnext), // 307
+ BSDX_(__NR_kldload, sys_kldload), // 304
+ BSDX_(__NR_kldunload, sys_kldunload), // 305
+ BSDX_(__NR_kldfind, sys_kldfind), // 306
+ BSDX_(__NR_kldnext, sys_kldnext), // 307
// BSDXY(__NR_kldstat, sys_kldstat), // 308
// BSDX_(__NR_kldfirstmod, sys_kldfirstmod), // 309
@@ -4095,7 +4141,7 @@
BSDX_(__NR_utrace, sys_utrace), // 335
// compat3 sendfile 336
-// BSDXY(__NR_kldsym, sys_kldsym), // 337
+ BSDXY(__NR_kldsym, sys_kldsym), // 337
// BSDX_(__NR_jail, sys_jail), // 338
// unimpl pioctl 339
diff -r ce1acb28953fd6928ccb8f9511e374eab66e8625 -r 7ecd33d57049211e1084fc5e8bf588da49088d75 include/vki/vki-freebsd.h
--- a/include/vki/vki-freebsd.h
+++ b/include/vki/vki-freebsd.h
@@ -2129,6 +2129,17 @@
void *spare[3];
};
+//----------------------------------------------------------------------
+// From sys/linker.h
+//----------------------------------------------------------------------
+
+struct vki_kld_sym_lookup {
+ int version; /* set to sizeof(struct kld_sym_lookup) */
+ char *symname; /* Symbol name we are looking up */
+ unsigned long symvalue;
+ vki_size_t symsize;
+};
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/

View file

@ -1,54 +0,0 @@
diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c
--- a/coregrind/m_syswrap/syswrap-freebsd.c
+++ b/coregrind/m_syswrap/syswrap-freebsd.c
@@ -3278,9 +3278,12 @@ PRE(sys_fcntl)
// These ones use ARG3 as "arg".
case VKI_F_DUPFD:
+ case VKI_F_DUPFD_CLOEXEC:
case VKI_F_SETFD:
case VKI_F_SETFL:
case VKI_F_SETOWN:
+ case VKI_F_READAHEAD:
+ case VKI_F_RDAHEAD:
PRINT("sys_fcntl[ARG3=='arg'] ( %ld, %ld, %ld )", ARG1,ARG2,ARG3);
PRE_REG_READ3(long, "fcntl",
unsigned int, fd, unsigned int, cmd, unsigned long, arg);
@@ -3300,6 +3303,7 @@ PRE(sys_fcntl)
// This one uses ARG3 as "oldd" and ARG4 as "newd".
case VKI_F_DUP2FD:
+ case VKI_F_DUP2FD_CLOEXEC:
PRINT("sys_fcntl[ARG3=='oldd', ARG4=='newd'] ( %ld, %ld, %ld, %ld )",
ARG1,ARG2,ARG3,ARG4);
PRE_REG_READ4(long, "fcntl",
@@ -3339,6 +3343,15 @@ POST(sys_fcntl)
ML_(record_fd_open_named)(tid, RES);
}
}
+ else if (ARG2 == VKI_F_DUPFD_CLOEXEC) {
+ if (!ML_(fd_allowed)(RES, "fcntl(DUPFD_CLOEXEC)", tid, True)) {
+ VG_(close)(RES);
+ SET_STATUS_Failure( VKI_EMFILE );
+ } else {
+ if (VG_(clo_track_fds))
+ ML_(record_fd_open_named)(tid, RES);
+ }
+ }
}
PRE(sys_ioctl)
diff --git a/include/vki/vki-freebsd.h b/include/vki/vki-freebsd.h
--- a/include/vki/vki-freebsd.h
+++ b/include/vki/vki-freebsd.h
@@ -1554,6 +1554,10 @@ struct vki_dirent {
#define VKI_F_SETLK 12 /* set record locking information */
#define VKI_F_SETLKW 13 /* F_SETLK; wait if blocked */
#define VKI_F_SETLK_REMOTE 14 /* debugging support for remote locks */
+#define VKI_F_READAHEAD 15 /* read ahead */
+#define VKI_F_RDAHEAD 16 /* Darwin compatible read ahead */
+#define VKI_F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */
+#define VKI_F_DUP2FD_CLOEXEC 18 /* Like F_DUP2FD, but FD_CLOEXEC is set */
/* for F_[GET|SET]FL */
#define VKI_FD_CLOEXEC 1 /* actually anything with low bit set goes */

View file

@ -1,11 +0,0 @@
--- VEX/auxprogs/genoffsets.c 2016-01-13 19:20:20 UTC
+++ VEX/auxprogs/genoffsets.c
@@ -59,7 +59,7 @@
#define VG_STRINGIFZ(__str) #__str
#define VG_STRINGIFY(__str) VG_STRINGIFZ(__str)
-#define my_offsetof(__type,__field) (&((__type*)0)->__field)
+#define my_offsetof(__type,__field) offsetof(__type,__field)
/* This forces gcc to evaluate the my_offsetof call at compile time,
and then emits it in the assembly, along with the nonsense string

View file

@ -1,21 +0,0 @@
--- configure.ac.orig 2016-01-13 19:20:20 UTC
+++ configure.ac
@@ -136,16 +136,10 @@
AM_CONDITIONAL(COMPILER_IS_CLANG, test $is_clang = clang)
case "${is_clang}-${gcc_version}" in
- notclang-3.*)
+ notclang-[[3-9]].*|notclang-[[1-9]][[0-9]]*)
AC_MSG_RESULT([ok (${gcc_version})])
;;
- notclang-4.*)
- AC_MSG_RESULT([ok (${gcc_version})])
- ;;
- notclang-5.*)
- AC_MSG_RESULT([ok (${gcc_version})])
- ;;
- clang-2.9|clang-3.*|clang-4.*)
+ clang-2.9|clang-[[3-9]].*|clang-[[1-9]][[0-9]]*)
AC_MSG_RESULT([ok (clang-${gcc_version})])
;;
*)

View file

@ -1,13 +0,0 @@
--- coregrind/m_debuglog.c.orig 2019-01-08 21:35:12.953178000 +0400
+++ coregrind/m_debuglog.c 2019-01-08 21:36:10.940827000 +0400
@@ -482,8 +482,8 @@
"popq %%r15\n" /* restore r15 */
"addq $256, %%rsp\n" /* restore stack ptr */
: /*wr*/
- : /*rd*/ "g" (block)
- : /*trash*/ "rax", "rdi", "rsi", "rdx", "memory", "cc"
+ : /*rd*/ "r" (block)
+ : /*trash*/ "rax", "rdi", "rsi", "rdx", "memory", "cc", "rcx", "r11"
);
if (block[0] < 0)
block[0] = -1;

View file

@ -1,30 +0,0 @@
--- coregrind/m_syswrap/syswrap-amd64-freebsd.c.orig 2015-01-26 16:17:32.000000000 -0400
+++ coregrind/m_syswrap/syswrap-amd64-freebsd.c 2015-08-31 09:51:17.506396000 -0300
@@ -691,6 +691,27 @@
SET_STATUS_Success2( tst->arch.vex.guest_FS_ZERO, tst->arch.vex.guest_RDX );
POST_MEM_WRITE( ARG2, sizeof(void *) );
break;
+ case VKI_AMD64_GET_XFPUSTATE:
+ {
+ UChar fpuState[160];
+ struct vki_amd64_get_xfpustate *xfs = (struct vki_amd64_get_xfpustate *)ARG2;
+ int fpuSaveLen;
+
+ PRINT("sys_amd64_get_xfpustate ( %#lx, %d )", (long unsigned int)xfs->addr, xfs->len);
+ tst = VG_(get_ThreadState)(tid);
+
+ if (xfs->len <= sizeof(fpuState)) {
+ amd64g_dirtyhelper_FXSAVE_ALL_EXCEPT_XMM(
+ (VexGuestAMD64State *)&tst->arch.vex,
+ (HWord)fpuState);
+ VG_(memcpy)(xfs->addr, fpuState, xfs->len);
+ POST_MEM_WRITE( xfs->addr, xfs->len );
+ SET_STATUS_Success ( 0 );
+ } else {
+ SET_STATUS_Failure( VKI_EINVAL );
+ }
+ }
+ break;
default:
VG_(message) (Vg_UserMsg, "unhandled sysarch cmd %ld", ARG1);
VG_(unimplemented) ("unhandled sysarch cmd");

View file

@ -1,34 +0,0 @@
--- include/vki/vki-freebsd.h.orig 2015-01-26 16:17:32.000000000 -0400
+++ include/vki/vki-freebsd.h 2015-08-31 04:55:29.139189000 -0300
@@ -684,6 +684,7 @@
#define VKI_SOCK_STREAM 1
+#include <sys/types.h>
#include <netinet/tcp.h>
#define VKI_TCP_NODELAY TCP_NODELAY
@@ -1888,11 +1889,23 @@
#define VKI_I386_SET_FSBASE 8
#define VKI_I386_GET_GSBASE 9
#define VKI_I386_SET_GSBASE 10
+#define VKI_I386_SET_XFPUSTATE 11
#define VKI_AMD64_GET_FSBASE 128
#define VKI_AMD64_SET_FSBASE 129
#define VKI_AMD64_GET_GSBASE 130
#define VKI_AMD64_SET_GSBASE 131
+#define VKI_AMD64_GET_XFPUSTATE 132
+
+typedef struct vki_i386_get_xfpustate {
+ unsigned int addr;
+ int len;
+};
+
+typedef struct vki_amd64_get_xfpustate {
+ void *addr;
+ int len;
+};
//----------------------------------------------------------------------
// From sys/module.h