You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
(1) |
2
(1) |
3
(5) |
4
(4) |
5
(7) |
6
(4) |
|
7
(3) |
8
(5) |
9
|
10
(5) |
11
|
12
(4) |
13
|
|
14
|
15
(3) |
16
(1) |
17
(2) |
18
|
19
(1) |
20
|
|
21
(1) |
22
|
23
|
24
|
25
|
26
(3) |
27
|
|
28
(2) |
29
(1) |
30
|
31
|
|
|
|
|
From: Julian S. <js...@ac...> - 2016-08-10 22:23:18
|
On 08/08/16 21:10, Mark Wielaard wrote: > Hi Julian, > > On Sun, 2016-08-07 at 23:36 +0000, sv...@va... wrote: >> none/tests/arm/v8crypto: >> * enable all tests in this file >> * add an expected output (stderr.exp) file > > The post-regtest-tests don't like that: > none/tests/arm/Makefile.am:1: error: v8crypto.stdout.exp is missing in EXTRA_DIST Fixed, r15935. Sorry for the breakage. J |
|
From: <sv...@va...> - 2016-08-10 22:22:29
|
Author: sewardj
Date: Wed Aug 10 23:22:20 2016
New Revision: 15935
Log:
Connect the v8crypto test to the build system, at least somewhat, so
as to make the post-regtest-tests happy. Still needs configure.ac
checking for "-mfpu=crypto-neon-fp-armv8" gcc flag support.
Added:
trunk/none/tests/arm/v8crypto.stderr.exp
trunk/none/tests/arm/v8crypto.vgtest
Modified:
trunk/none/tests/arm/Makefile.am
Modified: trunk/none/tests/arm/Makefile.am
==============================================================================
--- trunk/none/tests/arm/Makefile.am (original)
+++ trunk/none/tests/arm/Makefile.am Wed Aug 10 23:22:20 2016
@@ -12,6 +12,7 @@
v6intARM.stdout.exp v6intARM.stderr.exp v6intARM.vgtest \
v6intThumb.stdout.exp v6intThumb.stderr.exp v6intThumb.vgtest \
v6media.stdout.exp v6media.stderr.exp v6media.vgtest \
+ v8crypto.stdout.exp v8crypto.stderr.exp v8crypto.vgtest \
vcvt_fixed_float_VFP.stdout.exp vcvt_fixed_float_VFP.stderr.exp \
vcvt_fixed_float_VFP.vgtest \
vfp.stdout.exp vfp.stderr.exp vfp.vgtest \
@@ -27,6 +28,7 @@
v6intARM \
v6intThumb \
v6media \
+ v8crypto \
vcvt_fixed_float_VFP \
vfp \
vfpv4_fma
@@ -49,6 +51,8 @@
v6media_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -mthumb
+v8crypto_CFLAGS = $(AM_CFLAGS) -g -O0 -mfpu=crypto-neon-fp-armv8
+
vfp_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
-mfpu=neon \
-mthumb
Added: trunk/none/tests/arm/v8crypto.stderr.exp
==============================================================================
(empty)
Added: trunk/none/tests/arm/v8crypto.vgtest
==============================================================================
--- trunk/none/tests/arm/v8crypto.vgtest (added)
+++ trunk/none/tests/arm/v8crypto.vgtest Wed Aug 10 23:22:20 2016
@@ -0,0 +1,2 @@
+prog: v8crypto
+vgopts: -q
|
|
From: <sv...@va...> - 2016-08-10 14:38:18
|
Author: petarj
Date: Wed Aug 10 15:38:10 2016
New Revision: 15934
Log:
mips32: add support for FPXX mode
With this patch, MIPS32 Valgrind compiled with -mfpxx can handle all types
(regarding FP_ABI flag) of MIPS32 ELFs.
- Functions arch_elf_pt_proc() and arch_check_elf() are added to elf reader
according to linux/fs/binfmt_elf.c from Linux 4.1;
- Processing .MIPS.abiflags section and initializing appropriate FPU mode
for MIPS32 are added;
- Emulation of prctl(GET/SET_FP_MODE) sys-calls are implemented for MIPS32.
Patch by Aleksandar Rikalo <Ale...@im...>
Related VEX change: r3243.
This implements BZ#366079.
Modified:
trunk/coregrind/m_initimg/initimg-linux.c
trunk/coregrind/m_machine.c
trunk/coregrind/m_syswrap/syswrap-mips32-linux.c
trunk/coregrind/m_translate.c
trunk/coregrind/m_ume/elf.c
trunk/coregrind/pub_core_initimg.h
trunk/coregrind/pub_core_ume.h
trunk/include/pub_tool_basics.h
trunk/include/vki/vki-linux.h
trunk/include/vki/vki-mips32-linux.h
Modified: trunk/coregrind/m_initimg/initimg-linux.c
==============================================================================
--- trunk/coregrind/m_initimg/initimg-linux.c (original)
+++ trunk/coregrind/m_initimg/initimg-linux.c Wed Aug 10 15:38:10 2016
@@ -66,7 +66,7 @@
/* Load the client whose name is VG_(argv_the_exename). */
-static void load_client ( /*OUT*/ExeInfo* info,
+static void load_client ( /*MOD*/ExeInfo* info,
/*OUT*/Addr* client_ip,
/*OUT*/Addr* client_toc)
{
@@ -82,7 +82,6 @@
VG_(exit)(127); // 127 is Posix NOTFOUND
}
- VG_(memset)(info, 0, sizeof(*info));
ret = VG_(do_exec)(exe_name, info);
if (ret < 0) {
VG_(printf)("valgrind: could not execute '%s'\n", exe_name);
@@ -918,8 +917,14 @@
ExeInfo info;
HChar** env = NULL;
- IIFinaliseImageInfo iifii;
- VG_(memset)( &iifii, 0, sizeof(iifii) );
+ IIFinaliseImageInfo iifii = {
+ .clstack_max_size = 0,
+ .initial_client_SP = 0,
+ .initial_client_IP = 0,
+ .initial_client_TOC = 0,
+ .client_auxv = NULL,
+ .arch_elf_state = VKI_INIT_ARCH_ELF_STATE,
+ };
//--------------------------------------------------------------
// Load client executable, finding in $PATH if necessary
@@ -931,6 +936,9 @@
if (VG_(args_the_exename) == NULL)
VG_(err_missing_prog)();
+ VG_(memset)(&info, 0, sizeof(info));
+ info.arch_elf_state = &iifii.arch_elf_state;
+
load_client(&info, &iifii.initial_client_IP, &iifii.initial_client_TOC);
//--------------------------------------------------------------
@@ -1174,6 +1182,10 @@
arch->vex.guest_PC = iifii.initial_client_IP;
arch->vex.guest_r31 = iifii.initial_client_SP;
+ if (iifii.arch_elf_state.overall_fp_mode == VKI_FP_FR1) {
+ arch->vex.guest_CP0_status |= MIPS_CP0_STATUS_FR;
+ }
+
# elif defined(VGP_mips64_linux)
vg_assert(0 == sizeof(VexGuestMIPS64State) % LibVEX_GUEST_STATE_ALIGN);
/* Zero out the initial state, and set up the simulated FPU in a
Modified: trunk/coregrind/m_machine.c
==============================================================================
--- trunk/coregrind/m_machine.c (original)
+++ trunk/coregrind/m_machine.c Wed Aug 10 15:38:10 2016
@@ -1738,20 +1738,39 @@
}
}
- /* Check if CPU has FPU and 32 dbl. prec. FP registers */
- int FIR = 0;
- __asm__ __volatile__(
- "cfc1 %0, $0" "\n\t"
- : "=r" (FIR)
- );
- if (FIR & (1 << FP64)) {
- vai.hwcaps |= VEX_MIPS_CPU_32FPR;
- }
-
VG_(convert_sigaction_fromK_to_toK)(&saved_sigill_act, &tmp_sigill_act);
VG_(sigaction)(VKI_SIGILL, &tmp_sigill_act, NULL);
VG_(sigprocmask)(VKI_SIG_SETMASK, &saved_set, NULL);
+# if defined(VGP_mips32_linux)
+ Int fpmode = VG_(prctl)(VKI_PR_GET_FP_MODE);
+# else
+ Int fpmode = -1;
+# endif
+
+ if (fpmode < 0) {
+ /* prctl(PR_GET_FP_MODE) is not supported by Kernel,
+ we are using alternative way to determine FP mode */
+ ULong result = 0;
+ __asm__ volatile (
+ ".set push\n\t"
+ ".set noreorder\n\t"
+ ".set oddspreg\n\t"
+ "lui $t0, 0x3FF0\n\t"
+ "ldc1 $f0, %0\n\t"
+ "mtc1 $t0, $f1\n\t"
+ "sdc1 $f0, %0\n\t"
+ ".set pop\n\t"
+ : "+m"(result)
+ :
+ : "t0", "$f0", "$f1", "memory");
+
+ fpmode = (result != 0x3FF0000000000000ull);
+ }
+
+ if (fpmode != 0)
+ vai.hwcaps |= VEX_MIPS_HOST_FR;
+
VG_(debugLog)(1, "machine", "hwcaps = 0x%x\n", vai.hwcaps);
VG_(machine_get_cache_info)(&vai);
@@ -1772,6 +1791,8 @@
vai.endness = VexEndness_INVALID;
# endif
+ vai.hwcaps |= VEX_MIPS_HOST_FR;
+
VG_(machine_get_cache_info)(&vai);
return True;
Modified: trunk/coregrind/m_syswrap/syswrap-mips32-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-mips32-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-mips32-linux.c Wed Aug 10 15:38:10 2016
@@ -526,6 +526,7 @@
DECL_TEMPLATE (mips_linux, sys_cacheflush);
DECL_TEMPLATE (mips_linux, sys_set_thread_area);
DECL_TEMPLATE (mips_linux, sys_pipe);
+DECL_TEMPLATE (mips_linux, sys_prctl);
PRE(sys_mmap2)
{
@@ -784,6 +785,52 @@
}
}
+PRE (sys_prctl)
+{
+ switch (ARG1) {
+ case VKI_PR_SET_FP_MODE:
+ {
+ VexArchInfo vai;
+ VG_(machine_get_VexArchInfo)(NULL, &vai);
+ /* Reject unsupported modes */
+ if ((ARG2 & ~VKI_PR_FP_MODE_FR) ||
+ ((ARG2 & VKI_PR_FP_MODE_FR) &&
+ !VEX_MIPS_HOST_FP_MODE(vai.hwcaps))) {
+ SET_STATUS_Failure(VKI_EOPNOTSUPP);
+ } else {
+ if (!(VG_(threads)[tid].arch.vex.guest_CP0_status &
+ MIPS_CP0_STATUS_FR) != !(ARG2 & VKI_PR_FP_MODE_FR)) {
+ ThreadId t;
+ for (t = 1; t < VG_N_THREADS; t++) {
+ if (VG_(threads)[t].status != VgTs_Empty) {
+ if (ARG2 & VKI_PR_FP_MODE_FR) {
+ VG_(threads)[t].arch.vex.guest_CP0_status |=
+ MIPS_CP0_STATUS_FR;
+ } else {
+ VG_(threads)[t].arch.vex.guest_CP0_status &=
+ ~MIPS_CP0_STATUS_FR;
+ }
+ }
+ }
+ /* Discard all translations */
+ VG_(discard_translations)(0, 0xfffffffful, "prctl(PR_SET_FP_MODE)");
+ }
+ SET_STATUS_Success(0);
+ }
+ break;
+ }
+ case VKI_PR_GET_FP_MODE:
+ if (VG_(threads)[tid].arch.vex.guest_CP0_status & MIPS_CP0_STATUS_FR)
+ SET_STATUS_Success(VKI_PR_FP_MODE_FR);
+ else
+ SET_STATUS_Success(0);
+ break;
+ default:
+ WRAPPER_PRE_NAME(linux, sys_prctl)(tid, layout, arrghs, status, flags);
+ break;
+ }
+}
+
#undef PRE
#undef POST
@@ -991,7 +1038,7 @@
//..
LINX_ (__NR_setresgid, sys_setresgid), // 190
LINXY (__NR_getresgid, sys_getresgid), // 191
- LINXY (__NR_prctl, sys_prctl), // 192
+ PLAX_ (__NR_prctl, sys_prctl), // 192
PLAX_ (__NR_rt_sigreturn, sys_rt_sigreturn), // 193
LINXY (__NR_rt_sigaction, sys_rt_sigaction), // 194
LINXY (__NR_rt_sigprocmask, sys_rt_sigprocmask), // 195
Modified: trunk/coregrind/m_translate.c
==============================================================================
--- trunk/coregrind/m_translate.c (original)
+++ trunk/coregrind/m_translate.c Wed Aug 10 15:38:10 2016
@@ -1683,6 +1683,11 @@
# if defined(VGP_amd64_solaris)
vex_abiinfo.guest_amd64_assume_fs_is_const = True;
# endif
+# if defined(VGP_mips32_linux) || defined(VGP_mips64_linux)
+ ThreadArchState* arch = &VG_(threads)[tid].arch;
+ vex_abiinfo.guest_mips_fp_mode64 =
+ !!(arch->vex.guest_CP0_status & MIPS_CP0_STATUS_FR);
+# endif
/* Set up closure args. */
closure.tid = tid;
Modified: trunk/coregrind/m_ume/elf.c
==============================================================================
--- trunk/coregrind/m_ume/elf.c (original)
+++ trunk/coregrind/m_ume/elf.c Wed Aug 10 15:38:10 2016
@@ -74,6 +74,237 @@
Int fd;
};
+#if defined(VGO_linux)
+
+/*
+ arch_elf_pt_proc() - check a PT_LOPROC..PT_HIPROC ELF program header
+ @ehdr: The main ELF header
+ @phdr: The program header to check
+ @fd: The ELF file filedescriptor
+ @is_interpreter: True if the phdr is from the interpreter of the ELF
+ being loaded, else false.
+ @state: Architecture-specific state preserved throughout the process
+ of loading the ELF.
+
+ Inspects the program header phdr to validate its correctness and/or
+ suitability for the system. Called once per ELF program header in the
+ range PT_LOPROC to PT_HIPROC, for both the ELF being loaded and its
+ interpreter.
+
+ Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
+ with that return code.
+
+ arch_check_elf()
+ @ehdr: The main ELF header
+ @has_interpreter: True if the ELF has an interpreter, else false.
+ @state: Architecture-specific state preserved throughout the process
+ of loading the ELF.
+
+ Provides a final opportunity for architecture code to reject the loading
+ of the ELF. This is called after all program headers to be checked by
+ arch_elf_pt_proc have been.
+
+ Return: Zero to proceed with the ELF load, non-zero to fail the ELF load
+ with that return code.
+
+ Ref: linux/fs/binfmt_elf.c
+ */
+
+# if defined(VGP_mips32_linux)
+
+/* Ref: linux/arch/mips/kernel/elf.c */
+static inline Int arch_elf_pt_proc(ESZ(Ehdr) *ehdr,
+ ESZ(Phdr) *phdr,
+ Int fd, Bool is_interpreter,
+ struct vki_arch_elf_state *state)
+{
+ struct vki_mips_elf_abiflags_v0 abiflags;
+ SysRes sres;
+
+ if ( (ehdr->e_ident[EI_CLASS] == ELFCLASS32) &&
+ (ehdr->e_flags & VKI_EF_MIPS_FP64) ) {
+ /*
+ * Set MIPS_ABI_FP_OLD_64 for EF_MIPS_FP64. We will override it
+ * later if needed
+ */
+ if (is_interpreter)
+ state->interp_fp_abi = VKI_MIPS_ABI_FP_OLD_64;
+ else
+ state->fp_abi = VKI_MIPS_ABI_FP_OLD_64;
+ }
+
+ if (phdr->p_type != VKI_PT_MIPS_ABIFLAGS)
+ return 0;
+
+ if (phdr->p_filesz < sizeof(abiflags))
+ return VKI_EINVAL;
+
+ sres = VG_(pread)(fd, &abiflags, sizeof(abiflags), phdr->p_offset);
+
+ if (sr_isError(sres))
+ return sr_Err(sres);
+
+ if (sr_Res(sres) != sizeof(abiflags))
+ return VKI_EIO;
+
+ /* Record the required FP ABIs for use by arch_check_elf */
+ if (is_interpreter)
+ state->interp_fp_abi = abiflags.fp_abi;
+ else
+ state->fp_abi = abiflags.fp_abi;
+
+ return 0;
+}
+
+/* Ref: linux/arch/mips/kernel/elf.c */
+static inline Int arch_check_elf(ESZ(Ehdr) *ehdr,
+ Bool has_interpreter,
+ struct vki_arch_elf_state *state)
+{
+ struct mode_req {
+ Bool single;
+ Bool soft;
+ Bool fr1;
+ Bool frdefault;
+ Bool fre;
+ };
+
+ struct mode_req fpu_reqs[] = {
+ [VKI_MIPS_ABI_FP_ANY] = { True, True, True, True, True },
+ [VKI_MIPS_ABI_FP_DOUBLE] = { False, False, False, True, True },
+ [VKI_MIPS_ABI_FP_SINGLE] = { True, False, False, False, False },
+ [VKI_MIPS_ABI_FP_SOFT] = { False, True, False, False, False },
+ [VKI_MIPS_ABI_FP_OLD_64] = { False, False, False, False, False },
+ [VKI_MIPS_ABI_FP_XX] = { False, False, True, True, True },
+ [VKI_MIPS_ABI_FP_64] = { False, False, True, False, False },
+ [VKI_MIPS_ABI_FP_64A] = { False, False, True, False, True }
+ };
+
+ /* Mode requirements when .MIPS.abiflags is not present in the ELF.
+ Not present means that everything is acceptable except FR1. */
+ struct mode_req none_req = { True, True, False, True, True };
+
+ struct mode_req prog_req, interp_req;
+ Int fp_abi, interp_fp_abi, abi0, abi1, max_abi;
+ Bool is_mips64;
+
+ VexArchInfo vai;
+ VG_(machine_get_VexArchInfo)(NULL, &vai);
+
+ fp_abi = state->fp_abi;
+
+ if (has_interpreter) {
+ interp_fp_abi = state->interp_fp_abi;
+
+ abi0 = VG_MIN(fp_abi, interp_fp_abi);
+ abi1 = VG_MAX(fp_abi, interp_fp_abi);
+ } else {
+ abi0 = abi1 = fp_abi;
+ }
+
+ is_mips64 = (ehdr->e_ident[EI_CLASS] == ELFCLASS64) ||
+ (ehdr->e_flags & EF_MIPS_ABI2);
+
+ if (is_mips64) {
+ /* MIPS64 code always uses FR=1, thus the default is easy */
+ state->overall_fp_mode = VKI_FP_FR1;
+
+ /* Disallow access to the various FPXX & FP64 ABIs */
+ max_abi = VKI_MIPS_ABI_FP_SOFT;
+ } else {
+ /* Default to a mode capable of running code expecting FR=0 */
+
+ /* TODO: Should be changed during implementation of MIPS-R6 support.
+ state->overall_fp_mode = cpu_has_mips_r6 ? VKI_FP_FRE : VKI_FP_FR0; */
+ state->overall_fp_mode = VKI_FP_FR0;
+
+ /* Allow all ABIs we know about */
+ max_abi = VKI_MIPS_ABI_FP_64A;
+ }
+
+ if ((abi0 > max_abi && abi0 != VKI_MIPS_ABI_FP_UNKNOWN) ||
+ (abi1 > max_abi && abi1 != VKI_MIPS_ABI_FP_UNKNOWN))
+ return VKI_ELIBBAD;
+
+ /* It's time to determine the FPU mode requirements */
+ prog_req = (abi0 == VKI_MIPS_ABI_FP_UNKNOWN) ? none_req : fpu_reqs[abi0];
+ interp_req = (abi1 == VKI_MIPS_ABI_FP_UNKNOWN) ? none_req : fpu_reqs[abi1];
+
+ /* Check whether the program's and interp's ABIs have a matching FPU
+ mode requirement. */
+ prog_req.single = interp_req.single && prog_req.single;
+ prog_req.soft = interp_req.soft && prog_req.soft;
+ prog_req.fr1 = interp_req.fr1 && prog_req.fr1;
+ prog_req.frdefault = interp_req.frdefault && prog_req.frdefault;
+ prog_req.fre = interp_req.fre && prog_req.fre;
+
+ /* Determine the desired FPU mode
+
+ Decision making:
+
+ - We want FR_FRE if FRE=1 and both FR=1 and FR=0 are false. This
+ means that we have a combination of program and interpreter
+ that inherently require the hybrid FP mode.
+ - If FR1 and FRDEFAULT is true, that means we hit the any-abi or
+ fpxx case. This is because, in any-ABI (or no-ABI) we have no FPU
+ instructions so we don't care about the mode. We will simply use
+ the one preferred by the hardware. In fpxx case, that ABI can
+ handle both FR=1 and FR=0, so, again, we simply choose the one
+ preferred by the hardware. Next, if we only use single-precision
+ FPU instructions, and the default ABI FPU mode is not good
+ (ie single + any ABI combination), we set again the FPU mode to the
+ one is preferred by the hardware. Next, if we know that the code
+ will only use single-precision instructions, shown by single being
+ true but frdefault being false, then we again set the FPU mode to
+ the one that is preferred by the hardware.
+ - We want FP_FR1 if that's the only matching mode and the default one
+ is not good.
+ - Return with ELIBADD if we can't find a matching FPU mode. */
+ if (prog_req.fre && !prog_req.frdefault && !prog_req.fr1)
+ state->overall_fp_mode = VKI_FP_FRE;
+ else if ((prog_req.fr1 && prog_req.frdefault) ||
+ (prog_req.single && !prog_req.frdefault))
+ state->overall_fp_mode = VEX_MIPS_HOST_FP_MODE(vai.hwcaps) ?
+ VKI_FP_FR1 : VKI_FP_FR0;
+ else if (prog_req.fr1)
+ state->overall_fp_mode = VKI_FP_FR1;
+ else if (!prog_req.fre && !prog_req.frdefault &&
+ !prog_req.fr1 && !prog_req.single && !prog_req.soft)
+ return VKI_ELIBBAD;
+
+ /* TODO: Currently, Valgrind doesn't support FRE and doesn't support FR1
+ emulation on FR0 system, so in those cases we are forced to
+ reject the ELF. */
+ if ((state->overall_fp_mode == VKI_FP_FRE) ||
+ ((state->overall_fp_mode == VKI_FP_FR1) &&
+ !VEX_MIPS_HOST_FP_MODE(vai.hwcaps)))
+ return VKI_ELIBBAD;
+
+ return 0;
+}
+
+# else
+
+static inline Int arch_elf_pt_proc(ESZ(Ehdr) *ehdr,
+ ESZ(Phdr) *phdr,
+ Int fd, Bool is_interpreter,
+ struct vki_arch_elf_state *state)
+{
+ /* Dummy implementation, always proceed */
+ return 0;
+}
+
+static inline Int arch_check_elf(ESZ(Ehdr) *ehdr,
+ Bool has_interpreter,
+ struct vki_arch_elf_state *state)
+{
+ /* Dummy implementation, always proceed */
+ return 0;
+}
+
+# endif
+#endif
+
static void check_mmap(SysRes res, Addr base, SizeT len)
{
if (sr_isError(res)) {
@@ -316,6 +547,10 @@
ESZ(Addr) thrptr_addr = 0;
# endif
+# if defined(VGO_linux)
+ Int retval;
+# endif
+
# if defined(HAVE_PIE)
ebase = info->exe_base;
# endif
@@ -435,6 +670,15 @@
}
# endif
+# if defined(VGO_linux)
+ if ((iph->p_type >= PT_LOPROC) && (iph->p_type <= PT_HIPROC)) {
+ retval = arch_elf_pt_proc(&interp->e, iph, intfd, True,
+ info->arch_elf_state);
+ if (retval)
+ return retval;
+ }
+# endif
+
if (iph->p_type != PT_LOAD || iph->p_memsz == 0)
continue;
@@ -481,12 +725,28 @@
break;
# endif
+# if defined(VGO_linux)
+ case PT_LOPROC ... PT_HIPROC:
+ retval = arch_elf_pt_proc(&e->e, ph, fd, False, info->arch_elf_state);
+ if (retval)
+ return retval;
+ break;
+# endif
+
default:
// do nothing
break;
}
}
+# if defined(VGO_linux)
+ retval = arch_check_elf(&e->e,
+ interp != NULL,
+ info->arch_elf_state);
+ if (retval)
+ return retval;
+# endif
+
if (info->phdr == 0)
info->phdr = minaddr + ebase + e->e.e_phoff;
Modified: trunk/coregrind/pub_core_initimg.h
==============================================================================
--- trunk/coregrind/pub_core_initimg.h (original)
+++ trunk/coregrind/pub_core_initimg.h Wed Aug 10 15:38:10 2016
@@ -88,6 +88,8 @@
Addr initial_client_IP;
Addr initial_client_TOC;
UInt* client_auxv;
+ /* ------ Arch-specific ELF loading state ------ */
+ struct vki_arch_elf_state arch_elf_state;
};
/* ------------------------- Darwin ------------------------- */
Modified: trunk/coregrind/pub_core_ume.h
==============================================================================
--- trunk/coregrind/pub_core_ume.h (original)
+++ trunk/coregrind/pub_core_ume.h Wed Aug 10 15:38:10 2016
@@ -70,6 +70,11 @@
Bool ldsoexec; // OUT: the program is the runtime linker itself
#endif
+#if defined(VGO_linux)
+ // INOUT: architecture-specific ELF loading state
+ struct vki_arch_elf_state *arch_elf_state;
+#endif
+
Addr entry; // OUT: entrypoint in main executable
Addr init_ip; // OUT: address of first instruction to execute
Addr brkbase; // OUT: base address of brk segment
Modified: trunk/include/pub_tool_basics.h
==============================================================================
--- trunk/include/pub_tool_basics.h (original)
+++ trunk/include/pub_tool_basics.h Wed Aug 10 15:38:10 2016
@@ -461,6 +461,9 @@
#define STATIC_ASSERT(x) extern int VG_(VG_(VG_(unused)))[(x) ? 1 : -1] \
__attribute__((unused))
+#define VG_MAX(a,b) ((a) > (b) ? a : b)
+#define VG_MIN(a,b) ((a) < (b) ? a : b)
+
#endif /* __PUB_TOOL_BASICS_H */
/*--------------------------------------------------------------------*/
Modified: trunk/include/vki/vki-linux.h
==============================================================================
--- trunk/include/vki/vki-linux.h (original)
+++ trunk/include/vki/vki-linux.h Wed Aug 10 15:38:10 2016
@@ -4692,6 +4692,32 @@
unsigned long iomap_base; /* cookie passed into ioremap */
};
+//----------------------------------------------------------------------
+// From linux-3.19.0/fs/binfmt_elf.c
+//----------------------------------------------------------------------
+
+#if !defined(VKI_INIT_ARCH_ELF_STATE)
+ /* This structure is used to preserve architecture specific data during
+ the loading of an ELF file, throughout the checking of architecture
+ specific ELF headers & through to the point where the ELF load is
+ known to be proceeding. This implementation is a dummy for
+ architectures which require no specific state. */
+ struct vki_arch_elf_state {
+ };
+
+# define VKI_INIT_ARCH_ELF_STATE { }
+
+#endif
+
+//----------------------------------------------------------------------
+// From linux-4.0/include/uapi/linux/prctl.h
+//----------------------------------------------------------------------
+
+#define VKI_PR_SET_FP_MODE 45
+#define VKI_PR_GET_FP_MODE 46
+# define VKI_PR_FP_MODE_FR (1 << 0) /* 64b FP registers */
+# define VKI_PR_FP_MODE_FRE (1 << 1) /* 32b compatibility */
+
#endif // __VKI_LINUX_H
/*--------------------------------------------------------------------*/
Modified: trunk/include/vki/vki-mips32-linux.h
==============================================================================
--- trunk/include/vki/vki-mips32-linux.h (original)
+++ trunk/include/vki/vki-mips32-linux.h Wed Aug 10 15:38:10 2016
@@ -982,12 +982,79 @@
#define ARCH_HAS_SOCKET_TYPES 1
//----------------------------------------------------------------------
+// From linux-3.7.0/arch/mips/include/uapi/asm/errno.h
+//----------------------------------------------------------------------
+
+#define VKI_ELIBBAD 84 /* Accessing a corrupted shared library */
+#define VKI_EOPNOTSUPP 122 /* Operation not supported on transport
+ endpoint */
+
+//----------------------------------------------------------------------
// From linux-3.13.0/include/asm/errno.h
//----------------------------------------------------------------------
#define VKI_ENOSYS 89 /* Function not implemented */
#define VKI_EOVERFLOW 79 /* Value too large for defined data type */
+//----------------------------------------------------------------------
+// From linux-3.14.0/arch/mips/include/asm/elf.h
+//----------------------------------------------------------------------
+
+#define VKI_EF_MIPS_FP64 0x00000200
+
+//----------------------------------------------------------------------
+// From linux-4.1.0/arch/mips/include/asm/elf.h
+//----------------------------------------------------------------------
+
+#define VKI_MIPS_ABI_FP_UNKNOWN (-1)
+#define VKI_MIPS_ABI_FP_ANY 0 /* FP ABI doesn't matter */
+#define VKI_MIPS_ABI_FP_DOUBLE 1 /* -mdouble-float */
+#define VKI_MIPS_ABI_FP_SINGLE 2 /* -msingle-float */
+#define VKI_MIPS_ABI_FP_SOFT 3 /* -msoft-float */
+#define VKI_MIPS_ABI_FP_OLD_64 4 /* -mips32r2 -mfp64 */
+#define VKI_MIPS_ABI_FP_XX 5 /* -mfpxx */
+#define VKI_MIPS_ABI_FP_64 6 /* -mips32r2 -mfp64 */
+#define VKI_MIPS_ABI_FP_64A 7 /* -mips32r2 -mfp64 -mno-odd-spreg */
+
+struct vki_arch_elf_state {
+ int fp_abi;
+ int interp_fp_abi;
+ int overall_fp_mode;
+};
+
+#define VKI_INIT_ARCH_ELF_STATE { \
+ .fp_abi = VKI_MIPS_ABI_FP_UNKNOWN, \
+ .interp_fp_abi = VKI_MIPS_ABI_FP_UNKNOWN, \
+ .overall_fp_mode = -1, \
+}
+
+struct vki_mips_elf_abiflags_v0 {
+ vki_u16 version; /* Version of flags structure */
+ vki_u8 isa_level; /* The level of the ISA: 1-5, 32, 64 */
+ vki_u8 isa_rev; /* The revision of ISA: 0 for MIPS V and below,
+ 1-n otherwise */
+ vki_u8 gpr_size; /* The size of general purpose registers */
+ vki_u8 cpr1_size; /* The size of co-processor 1 registers */
+ vki_u8 cpr2_size; /* The size of co-processor 2 registers */
+ vki_u8 fp_abi; /* The floating-point ABI */
+ vki_u32 isa_ext; /* Mask of processor-specific extensions */
+ vki_u32 ases; /* Mask of ASEs used */
+ vki_u32 flags1; /* Mask of general flags */
+ vki_u32 flags2;
+};
+
+#define VKI_PT_MIPS_ABIFLAGS 0x70000003
+
+//----------------------------------------------------------------------
+// From linux-4.1.0/arch/mips/kernel/elf.c
+//----------------------------------------------------------------------
+
+enum {
+ VKI_FP_FRE,
+ VKI_FP_FR0,
+ VKI_FP_FR1,
+};
+
#endif // __VKI_MIPS32_LINUX_H
/*--------------------------------------------------------------------*/
|
Author: petarj
Date: Wed Aug 10 15:33:21 2016
New Revision: 3243
Log:
mips32: extend the current fp-mode code to support fpxx features
Part of the changes to support FPXX mode for MIPS32.
Patch by Aleksandar Rikalo <Ale...@im...>
Related issue BZ #366079.
Modified:
trunk/priv/guest_mips_helpers.c
trunk/priv/guest_mips_toIR.c
trunk/priv/host_mips_isel.c
trunk/pub/libvex.h
trunk/pub/libvex_guest_mips32.h
trunk/pub/libvex_guest_mips64.h
Modified: trunk/priv/guest_mips_helpers.c
==============================================================================
--- trunk/priv/guest_mips_helpers.c (original)
+++ trunk/priv/guest_mips_helpers.c Wed Aug 10 15:33:21 2016
@@ -165,6 +165,8 @@
vex_state->guest_COND = 0;
+ vex_state->guest_CP0_status = 0;
+
/* MIPS32 DSP ASE(r2) specific registers */
vex_state->guest_DSPControl = 0; /* DSPControl register */
vex_state->guest_ac0 = 0; /* Accumulator 0 */
@@ -272,6 +274,8 @@
vex_state->guest_NRADDR = 0;
vex_state->guest_COND = 0;
+
+ vex_state->guest_CP0_status = MIPS_CP0_STATUS_FR;
}
/*-----------------------------------------------------------*/
Modified: trunk/priv/guest_mips_toIR.c
==============================================================================
--- trunk/priv/guest_mips_toIR.c (original)
+++ trunk/priv/guest_mips_toIR.c Wed Aug 10 15:33:21 2016
@@ -17300,10 +17300,7 @@
vassert(guest_arch == VexArchMIPS32 || guest_arch == VexArchMIPS64);
mode64 = guest_arch != VexArchMIPS32;
-#if (__mips_fpr==64)
- fp_mode64 = (VEX_MIPS_HAS_32_64BIT_FPRS(archinfo->hwcaps)
- || guest_arch == VexArchMIPS64);
-#endif
+ fp_mode64 = abiinfo->guest_mips_fp_mode64;
guest_code = guest_code_IN;
irsb = irsb_IN;
Modified: trunk/priv/host_mips_isel.c
==============================================================================
--- trunk/priv/host_mips_isel.c (original)
+++ trunk/priv/host_mips_isel.c Wed Aug 10 15:33:21 2016
@@ -4183,10 +4183,7 @@
|| archinfo_host->endness == VexEndnessBE);
mode64 = arch_host != VexArchMIPS32;
-#if (__mips_fpr==64)
- fp_mode64 = (VEX_MIPS_HAS_32_64BIT_FPRS(hwcaps_host)
- || arch_host == VexArchMIPS64);
-#endif
+ fp_mode64 = VEX_MIPS_HOST_FP_MODE(hwcaps_host);
/* Make up an initial environment to use. */
env = LibVEX_Alloc_inline(sizeof(ISelEnv));
Modified: trunk/pub/libvex.h
==============================================================================
--- trunk/pub/libvex.h (original)
+++ trunk/pub/libvex.h Wed Aug 10 15:33:21 2016
@@ -227,8 +227,7 @@
/*
* Instead of Company Options values, bits 31:24 will be packed with
- * additional information, such as isa level and presence of FPU unit
- * with 32 64-bit registers.
+ * additional information, such as isa level and FP mode.
*/
#define VEX_MIPS_CPU_ISA_M32R1 0x01000000
#define VEX_MIPS_CPU_ISA_M32R2 0x02000000
@@ -236,8 +235,8 @@
#define VEX_MIPS_CPU_ISA_M64R2 0x08000000
#define VEX_MIPS_CPU_ISA_M32R6 0x10000000
#define VEX_MIPS_CPU_ISA_M64R6 0x20000000
-/* CPU has FPU and 32 dbl. prec. FP registers */
-#define VEX_MIPS_CPU_32FPR 0x40000000
+/* FP mode is FR = 1 (32 dbl. prec. FP registers) */
+#define VEX_MIPS_HOST_FR 0x40000000
/* Get MIPS Extended Information */
#define VEX_MIPS_EX_INFO(x) ((x) & 0xFF000000)
/* Get MIPS Company ID from HWCAPS */
@@ -246,10 +245,10 @@
#define VEX_MIPS_PROC_ID(x) ((x) & 0x0000FF00)
/* Get MIPS Revision from HWCAPS */
#define VEX_MIPS_REV(x) ((x) & 0x000000FF)
-/* Check if the processor has 32 64-bit FP registers */
-#define VEX_MIPS_HAS_32_64BIT_FPRS(x) (VEX_MIPS_EX_INFO(x) | VEX_MIPS_CPU_32FPR)
+/* Get host FP mode */
+#define VEX_MIPS_HOST_FP_MODE(x) (!!(VEX_MIPS_EX_INFO(x) & VEX_MIPS_HOST_FR))
/* Check if the processor supports MIPS32R2. */
-#define VEX_MIPS_CPU_HAS_MIPS32R2(x) (VEX_MIPS_EX_INFO(x) | \
+#define VEX_MIPS_CPU_HAS_MIPS32R2(x) (VEX_MIPS_EX_INFO(x) & \
VEX_MIPS_CPU_ISA_M32R2)
/* Check if the processor supports DSP ASE Rev 2. */
#define VEX_MIPS_PROC_DSP2(x) ((VEX_MIPS_COMP_ID(x) == VEX_PRID_COMP_MIPS) && \
@@ -406,6 +405,8 @@
function descriptor on the host, or to the function code
itself? True => descriptor, False => code. */
Bool host_ppc_calls_use_fndescrs;
+
+ Bool guest_mips_fp_mode64;
}
VexAbiInfo;
Modified: trunk/pub/libvex_guest_mips32.h
==============================================================================
--- trunk/pub/libvex_guest_mips32.h (original)
+++ trunk/pub/libvex_guest_mips32.h Wed Aug 10 15:33:21 2016
@@ -147,7 +147,9 @@
/* 472 */ ULong guest_ac2;
/* 480 */ ULong guest_ac3;
- UInt padding;
+ /* 488 */ UInt guest_CP0_status;
+
+ /* 492 */ UInt padding;
} VexGuestMIPS32State;
/*---------------------------------------------------------------*/
/*--- Utility functions for MIPS32 guest stuff. ---*/
@@ -160,6 +162,8 @@
extern
void LibVEX_GuestMIPS32_initialise ( /*OUT*/VexGuestMIPS32State* vex_state );
+/* FR bit of CP0_STATUS_FR register */
+#define MIPS_CP0_STATUS_FR (1ul << 26)
#endif /* ndef __LIBVEX_PUB_GUEST_MIPS32_H */
Modified: trunk/pub/libvex_guest_mips64.h
==============================================================================
--- trunk/pub/libvex_guest_mips64.h (original)
+++ trunk/pub/libvex_guest_mips64.h Wed Aug 10 15:33:21 2016
@@ -123,6 +123,8 @@
/* 548 */ UInt guest_FENR;
/* 552 */ UInt guest_FCSR;
+ /* 556 */ UInt guest_CP0_status;
+
/* TLS pointer for the thread. It's read-only in user space. On Linux it
is set in user space by various thread-related syscalls.
User Local Register.
@@ -159,6 +161,9 @@
extern
void LibVEX_GuestMIPS64_initialise ( /*OUT*/VexGuestMIPS64State* vex_state );
+/* FR bit of CP0_STATUS_FR register */
+#define MIPS_CP0_STATUS_FR (1ul << 26)
+
#endif /* ndef __LIBVEX_PUB_GUEST_MIPS64_H */
/*---------------------------------------------------------------*/
|
|
From: Ivo R. <iv...@iv...> - 2016-08-10 03:25:07
|
Ruurd, Thank you for describing your problems and attaching the patch. Please split the patch into several pieces by functionality so they can be more easily handled and reviewed. Then submit a bug report for each of them as per: http://valgrind.org/support/bug_reports.html I am in no way able to tell you whether any of these will make it in the repository. But I have a few comments whose addressing could make that more likely to happen: 1. Please drop version 3.11.1. This is reserved for a maintenance release. 2. Include test case(s) which can be integrated in the repository. 3. Specify which systems (OS/arch) you tested on. 4. As regards sbrk limit, Linux and Solaris differ here as they use different virtual address space management strategy. I cannot speak about Darwin but I guess it follows Linux here. As you determined, Linux reserves very small data segment for sbrk growth. Subsequent segments for anonymous mappings (typically for shared libraries) are placed next to it, preventing further growth. Solaris uses different strategy - client space for anonymous mappings is allocated top down, like Solaris kernel does. This means that data segment has plenty of address space to grow because there is nothing preventing it. See comments in coregrind/m_aspacemgr/aspacemgr-linux.c. Examples: Situation on Linux with /bin/true: --17954:1: aspacem 0: RSVN 0000000000-00003fffff 4194304 ----- SmFixed --17954:1: aspacem 1: file 0000400000-0000405fff 24576 r-xT- d=0x801 i=17301669 o=0 (1,56) --17954:1: aspacem 2: RSVN 0000406000-0000604fff 2093056 ----- SmFixed --17954:1: aspacem 3: file 0000605000-0000605fff 4096 r---- d=0x801 i=17301669 o=20480 (1,56) --17954:1: aspacem 4: file 0000606000-0000606fff 4096 rw--- d=0x801 i=17301669 o=24576 (1,56) --17954:1: aspacem 5: RSVN 0000607000-0003ffffff 57m ----- SmFixed --17954:1: aspacem 6: file 0004000000-0004025fff 155648 r-xT- d=0x801 i=5505210 o=0 (2,70) --17954:1: aspacem 7: anon 0004026000-0004027fff 8192 rw--- --17954:1: aspacem 8: 0004028000-0004046fff 126976 --17954:1: aspacem 9: anon 0004047000-0004048fff 8192 rw--- --17954:1: aspacem 10: 0004049000-0004224fff 1949696 --17954:1: aspacem 11: file 0004225000-0004225fff 4096 r---- d=0x801 i=5505210 o=151552 (2,70) --17954:1: aspacem 12: file 0004226000-0004226fff 4096 rw--- d=0x801 i=5505210 o=155648 (2,70) --17954:1: aspacem 13: anon 0004227000-0004227fff 4096 rw--- --17954:1: aspacem 14: anon 0004228000-0004228fff 4096 rwx-- --17954:1: aspacem 15: RSVN 0004229000-0004a27fff 8384512 ----- SmLower --17954:1: aspacem 16: file 0004a28000-0004a28fff 4096 r-xT- d=0x801 i=23464128 o=0 (4,165) --17954:1: aspacem 17: file 0004a29000-0004c27fff 2093056 ----- d=0x801 i=23464128 o=4096 (4,165) --17954:1: aspacem 18: file 0004c28000-0004c28fff 4096 r---- d=0x801 i=23464128 o=0 (4,165) --17954:1: aspacem 19: file 0004c29000-0004c29fff 4096 rw--- d=0x801 i=23464128 o=4096 (4,165) ... Here segment 14 is data segment and 15 is its reservation, allowing for 8 MB growth. However segments 16+ for anonymous mappings (shared libraries) prevent any further growth. Situation on Solaris with /bin/true: --15522:1: aspacem 0: RSVN 0000000000-00000fffff 1048576 ----- SmFixed --15522:1: aspacem 1: 0000100000-0000107fff 32768 --15522:1: aspacem 2: file 0000108000-0000108fff 4096 r-xT- d=0xe700010002 i=38842 o=0 (1,70) --15522:1: aspacem 3: 0000109000-0000208fff 1048576 --15522:1: aspacem 4: file 0000209000-0000209fff 4096 rw--- d=0xe700010002 i=38842 o=4096 (1,70) --15522:1: aspacem 5: anon 000020a000-0000a09fff 8388608 rw--- --15522:1: aspacem 6: RSVN 0000a0a000-0000a0afff 4096 ----- SmLower --15522:1: aspacem 7: 0000a0b000-00377effff 877m --15522:1: aspacem 8: RSVN 00377f0000-0037fecfff 8376320 ----- SmUpper --15522:1: aspacem 9: anon 0037fed000-0037feffff 12288 rwx-- --15522:1: aspacem 10: 0037ff0000-0037ffffff 65536 --15522:1: aspacem 11: FILE 0038000000-00380ebfff 966656 r-x-- d=0xe70001000a i=65450 o=4096 (0,4) --15522:1: aspacem 12: file 00380ec000-00380ecfff 4096 r-xT- d=0xe70001000a i=65450 o=970752 (0,4) ... Here segment 5 is data segment (with initial size of 8 MB) and segment 6 is a reservation segment to separate it from other anonymous mappings. Segment 7 is a free virtual address space where data segment can grow. Starting at segment 11, valgrind executable segments follow. Therefore I'd say that to properly fix a problem with data segment on Linux, it will have to follow Solaris lead here. Introducing another command line option "main-sbrksize" does not help much because you'd have to know it exists and how much memory a priori to specify. Valgrind should give you that functionality automatically. Kind regards, I. |