66 Commits

Author SHA1 Message Date
Paul Floyd
68bb7c063f FreeBSD support, patch 12
coregrind modified files
2021-10-09 15:01:08 +02:00
Mark Wielaard
461cc5c003 Cleanup GPL header address notices by using http://www.gnu.org/licenses/
Sync VEX/LICENSE.GPL with top-level COPYING file. We used 3 different
addresses for writing to the FSF to receive a copy of the GPL. Replace
all different variants with an URL <http://www.gnu.org/licenses/>.

The following files might still have some slightly different (L)GPL
copyright notice because they were derived from other programs:

- files under coregrind/m_demangle which come from libiberty:
  cplus-dem.c, d-demangle.c, demangle.h, rust-demangle.c,
  safe-ctype.c and safe-ctype.h
- coregrind/m_demangle/dyn-string.[hc] derived from GCC.
- coregrind/m_demangle/ansidecl.h derived from glibc.
- VEX files for FMA detived from glibc:
  host_generic_maddf.h and host_generic_maddf.c
- files under coregrin/m_debuginfo derived from LZO:
  lzoconf.h, lzodefs.h, minilzo-inl.c and minilzo.h
- files under coregrind/m_gdbserver detived from GDB:
  gdb/signals.h, inferiors.c, regcache.c, regcache.h,
  regdef.h, remote-utils.c, server.c, server.h, signals.c,
  target.c, target.h and utils.c

Plus the following test files:

- none/tests/ppc32/testVMX.c derived from testVMX.
- ppc tests derived from QEMU: jm-insns.c, ppc64_helpers.h
  and test_isa_3_0.c
- tests derived from bzip2 (with embedded GPL text in code):
  hackedbz2.c, origin5-bz2.c, varinfo6.c
- tests detived from glibc: str_tester.c, pth_atfork1.c
- test detived from GCC libgomp: tc17_sembar.c
- performance tests derived from bzip2 or tinycc (with embedded GPL
  text in code): bz2.c, test_input_for_tinycc.c and tinycc.c
2019-05-26 20:07:51 +02:00
Tom Hughes
02b719e7b2 Revert r16455.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16456
2017-06-26 12:14:29 +00:00
Tom Hughes
1038ee89e5 Allow setuid/setgid/setcap binaries to be run if
valgrind is running as root.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16455
2017-06-26 12:10:42 +00:00
Ivo Raisr
d8f648486e Fix some spelling mistakes.
Fixes BZ#374719
Patch by: klemens <ka7@la-evento.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16336
2017-05-05 22:13:20 +00:00
Ivo Raisr
38edd50c0e Update copyright end year to 2017 in preparation for 3.13 release.
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16333
2017-05-04 15:09:39 +00:00
Rhys Kidd
f2c8220a6d macos: Improve macOS 10.12 support. bz#365327.
The new macOS 10.12 way of loading dylib (placing them at the end of the currently
loaded segments) requires that Valgrind needs to know where the last segment was loaded.

A new structure (load_info_t) has been created to store all this information and easily
carry it around.

Changes:
- dyld text address is relative instead of absolute (macOS 10.12)
- Handle dylinker's offset (macOS 10.12)
- Handle the executable requesting a non-default stack address (macOS 10.12)
- Refactor to use load_info_t structure (all macOS)

Patch from Louis Brunner.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16318
2017-04-29 22:06:20 +00:00
Rhys Kidd
6fbaf672c8 macos: Improve consistency of VG_(printf)() usage in coregrind/m_ume/macho.c. n-i-bz.
Identified in the process of reviewing a proposed fix for bz#365327.

Patch from Louis Brunner.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16317
2017-04-29 19:39:54 +00:00
Philippe Waroquiers
450928f8aa Further fixes following fix of leak in 16033
Rerunning valgrind under valgrind shows that interp_name and interp_args
memory was freed twice.
=> reworked the way interp_name and interp_args are freed:
* free them in VG_(ii_create_image) (linux/darwin/solaris)
* everywhere else, when overriden, first free the current value
* everywhere where interp_name or interp_args are freed, set them to NULL

With this, re-selfhosting valgrind shows no leak and no corruption
for interp_name and interp_args.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16044
2016-10-16 17:20:53 +00:00
Ivo Raisr
b0b7bbf30b Follow up to SVN commit r15936.
Fix the sloppy check I introduced.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15939
2016-08-17 18:05:13 +00:00
Ivo Raisr
6260274e4e Follow recent Solaris development with respect to
SUNWDTRACE program header. Newer Solaris no longer utilizes
this program header as a scratchspace for DTrace fasttrap
provider, before libc is loaded.
For the time being, it serves as a space for initial thread
pointer.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15936
2016-08-12 22:28:50 +00:00
Petar Jovanovic
030cea68c8 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 <Aleksandar.Rikalo@imgtec.com>

Related VEX change: r3243.

This implements BZ#366079.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15934
2016-08-10 14:38:10 +00:00
Ivo Raisr
b00530b6de Distinguish properly when to establish the client data segment.
Initial data segment is established (see initimg-solaris.c for rationale):
- directly during client program image initialization,
- or on demand when the executed program is the runtime linker itself,
  after it has loaded its target dynamic executable (see PRE(sys_mmapobj)),
  or when the first brk() syscall is made.

More preparatory work for ldsoexec support.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15583
2015-08-22 22:08:43 +00:00
Julian Seward
adc2dafee9 Update copyright dates, to include 2015. No functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15577
2015-08-21 11:32:26 +00:00
Ivo Raisr
707501d444 Runtime linker ld.so.1 can be now run under Valgrind on Solaris.
Fixes BZ#351386.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15562
2015-08-17 19:13:12 +00:00
Ivo Raisr
9ac1832814 Check for Solaris specific program headers PT_SUNW_SYSSTAT and PT_SUNW_SYSSTAT_ZONE;
and act accordingly. Test cases provided. n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15469
2015-08-01 21:53:08 +00:00
Ivo Raisr
5633f3b114 Fix hard-to-understand code in VG_(load_ELF)().
Although it is a valid C [1], the closing bracket for "case PT_INTERP" is misplaced.
Fixes BZ #350854.

[1] https://en.wikipedia.org/wiki/Duff%27s_device#Mechanism


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15467
2015-08-01 12:11:09 +00:00
Florian Krohm
128fe0d9c4 Fix BZ #338606. Basically, the bug was that it was believed that
the interpreter following the #! has to be an absolute path name.
Not so; relative path works just fine.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15429
2015-07-21 21:37:23 +00:00
Julian Seward
ac60633d65 Bug 345248 - add support for Solaris OS in valgrind
Authors of this port:
    Petr Pavlu         setup@dagobah.cz
    Ivo Raisr          ivosh@ivosh.net
    Theo Schlossnagle  theo@omniti.com
            


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15426
2015-07-21 14:44:28 +00:00
Rhys Kidd
89c527ff7b Better align OS X error reporting with other platforms. Refer coregrind/m_ume/elf.c
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15408
2015-07-10 08:14:18 +00:00
Florian Krohm
fa7e44d039 Assorted cleanups: remove magic constants and unneeded header file. Update
a few comments. Exit with code 127 in bash emulation mode when file was
not found.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15077
2015-04-08 19:01:15 +00:00
Florian Krohm
909b88c40b When skipping white space after #! to find the interpreter
only skip ' ' and tabs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15063
2015-04-02 16:07:41 +00:00
Julian Seward
b519f73307 Adds initial support for AArch64 (arm64) on Android. Small programs
(/system/bin/ls, /system/bin/date) run.  Still to do:

* enable more malloc/free intercepts

* enable wrappers for ashmem and binder syscalls

* check to see if any special ioctl support is required for ARM Mali GPUs



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14690
2014-11-04 17:44:21 +00:00
Florian Krohm
33f32780a5 VG_(malloc/calloc/strdup) never return NULL (and never will).
So it's pointless to test or assert their return values.
Remove code doing so.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14528
2014-09-12 22:24:51 +00:00
Julian Seward
f30ed1a2f3 More stack-end-semantics fixups for MacOS following r14422 and r14392.
May fix #338878.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14488
2014-09-07 16:08:20 +00:00
Julian Seward
635ed73abb Followup to r14392 (fix up of stack bounds semantics) needed to keep
the darwin port from asserting at startup.  Patch from PhilippeW.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14422
2014-09-01 22:31:07 +00:00
Carl Love
98908947c7 This commit is for Bugzilla 334834. The Bugzilla contains patch 2 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334384 and 334836.

POWER PC, add the functional Little Endian support, patch 2 

The IBM POWER processor now supports both Big Endian and Little Endian.
The ABI for Little Endian also changes.  Specifically, the function
descriptor is not used, the stack size changed, accessing the TOC
changed.  Functions now have a local and a global entry point.  Register
r2 contains the TOC for local calls and register r12 contains the TOC
for global calls.  This patch makes the functional changes to the
Valgrind tool.  The patch makes the changes needed for the
none/tests/ppc32 and none/tests/ppc64 Makefile.am.  A number of the
ppc specific tests have Endian dependencies that are not fixed in
this patch.  They are fixed in the next patch.

Per Julian's comments renamed coregrind/m_dispatch/dispatch-ppc64-linux.S
to coregrind/m_dispatch/dispatch-ppc64be-linux.S  Created new file for LE
coregrind/m_dispatch/dispatch-ppc64le-linux.S.  The same was done for
coregrind/m_syswrap/syscall-ppc-linux.S.

Signed-off-by: Carl Love <carll@us.ibm.com>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14239
2014-08-07 23:35:54 +00:00
Carl Love
914f75de32 This commit is for Bugzilla 334384. The Bugzilla contains patch 1 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334834 and 334836.  The commit does not have a VEX commit associated with it.

POWER PC, add initial Little Endian support

The IBM POWER processor now supports both Big Endian and Little Endian.
This patch renames the #defines with the name ppc64 to ppc64be for the BE
specific code.  This patch adds the Little Endian #define ppc64le to the

Additionally, a few functions are renamed to remove BE from the name if the
function is used by BE and LE. Functions that are BE specific have BE put
in the name.

The goals of this patch is to make sure #defines, function names and
variables consistently use PPC64/ppc64 if it refers to BE and LE,
PPC64BE/ppc64be if it is specific to BE, PPC64LE/ppc64le if it is LE
specific.  The patch does not break the code for PPC64 Big Endian.

The test files memcheck/tests/atomic_incs.c, tests/power_insn_available.c
and tests/power_insn_available.c are also updated to the new #define
definition for PPC64 BE.

Signed-off-by: Carl Love <carll@us.ibm.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14238
2014-08-07 23:17:29 +00:00
Julian Seward
91350dc8a5 Add initial build support for Mac OS X 10.9 (Mavericks). Bug 326724
comment 12.  (Diego Giagio, diego@giagio.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14055
2014-06-20 11:48:38 +00:00
Tom Hughes
104fc12674 Check for setcap executables, as we already do for setuid and
setgid ones, and refuse to run them in the same way. BZ#335143.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13990
2014-05-22 08:57:06 +00:00
Tom Hughes
057f9b7069 The value of AT_BASE should be the offset between where the ELF interpreter
expected to be loaded (as expressed in the ELF headers) and where it was
actually loaded, and not (as valgrind was doing) the absolute value of the
load address for the interpreter.

Note that when prelink is not in use the two are normally the same, as the
intpreter (like all shared libraries) is normally linked with a zero load
address. When prelinked that is no longer true.

With that fixed, the hack to patch out AT_BASE to avoid confusing gdb on
systems where prelink is in use is no longer needed.

Fixes BZ#329612


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13768
2014-01-07 22:27:57 +00:00
Dejan Jevtic
423d0643b9 mips32: Adding mips32/Android support to Valgrind.
Necessary changes to Valgrind to support mips32 on Android.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13767
2013-12-27 09:06:55 +00:00
Julian Seward
dbf9b63605 Update copyright dates (20XY-2012 ==> 20XY-2013)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13658
2013-10-18 14:27:36 +00:00
Florian Krohm
a6c7a2893c Fix coregrind header files such that they can be included without
having to worry what other header files may have to be included
beforehand.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13549
2013-09-15 13:54:34 +00:00
Julian Seward
d4e4244597 Android's elf.h doesn't have PT_GNU_STACK (sigh) and so r13368 broke
the build.  This conditionalises that fragment on the present of
PT_GNU_STACK.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13375
2013-04-22 09:57:01 +00:00
Tom Hughes
11234a9407 Pay attention to PT_GNU_STACK when deciding what permissions to
use for the client stack.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13368
2013-04-17 10:08:04 +00:00
Julian Seward
509a6efaa9 Don't assume that page size is 4K when loading PIEs. Fixes #263034.
(Dodji Seketeli, dodji@redhat.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13351
2013-03-29 09:57:24 +00:00
Petar Jovanovic
5dd4c02e39 mips: adding MIPS64LE support to Valgrind
Necessary changes to Valgrind to support MIPS64LE on Linux.
Minor cleanup/style changes embedded in the patch as well.
The change corresponds to r2687 in VEX.
Patch written by Dejan Jevtic and Petar Jovanovic.

More information about this issue:
https://bugs.kde.org/show_bug.cgi?id=313267


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13292
2013-02-27 23:17:33 +00:00
Florian Krohm
66925ec149 Fix a few compiler warnings on Darwin.
Patch Guy Harris (guy@alum.mit.edu). Part of fixing BZ 312980.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13231
2013-01-15 03:19:54 +00:00
Florian Krohm
e7f4d4f57f Fix some casts that removed const-ness as pointed out by
GCC's -Wcast-qual.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13138
2012-11-24 19:41:54 +00:00
Florian Krohm
eec3191320 Char/HChar and constness fixes in m_ume
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13101
2012-11-03 18:28:20 +00:00
Julian Seward
4a3633e266 Update copyright dates to include 2012.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12843
2012-08-05 15:46:46 +00:00
Philippe Waroquiers
ab7b338320 301265 - add x86 support to Android build
Patch by Dragos Tatulea.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12835
2012-08-05 00:08:25 +00:00
Julian Seward
dc0ca811ec Un-break the build on OSX < 10.8 following r12814
(which was initial OSX 10.8 support)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12815
2012-08-02 18:51:51 +00:00
Julian Seward
f0c0f9f3ce Add initial support for MacOSX 10.8. Note this is still very borked
and pretty much unusable for real work.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12814
2012-08-02 18:25:04 +00:00
Julian Seward
f97a316e03 Fix loading of large Mach-O thin binaries. Bug #289470.
(Scott Byer, scottbyer@chromium.org)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12739
2012-07-13 13:34:31 +00:00
Julian Seward
0d7caa744f Get a bunch more copyright dates in the right format, 20xx-2011,
so the auto-update script will handle them correctly in future.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12207
2011-10-23 07:49:30 +00:00
Julian Seward
c96096ab24 Update all copyright dates, from 20xy-2010 to 20xy-2011.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12206
2011-10-23 07:32:08 +00:00
Julian Seward
d3bb08f53b Ignore ELF phdrs that have a p_memsz of zero, as appears to happen
on Android.  Bug 266035 comment 30.  (John Reiser, jreiser@bitwagon.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11878
2011-07-12 06:24:23 +00:00
Julian Seward
dc3f94c3e9 /bin/sh lives at /system/bin/sh on Android.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11877
2011-07-12 06:19:05 +00:00