Commit Graph

108 Commits

Author SHA1 Message Date
Conrad Ratschan
b04764d2e7 Add regression tests for powerpc PIE endianness 2020-10-03 23:43:53 -05:00
Pablo Galindo
a89d508130 Handle libraries with more than one .shstrtab section 2020-09-22 20:59:55 +01:00
Jörg Thalheim
9621e85b9e add regression test for NOTE section relocation 2020-07-31 08:33:32 +01:00
Domen Kožar
4dc6e9e3d5 Merge pull request #130 from am813nt/master
Fixed parallel execution of tests (parallel-tests in automake)
2020-06-16 10:18:22 +02:00
Aaron D. Marasco
e522b14edc Add libasan build option and test print-needed
(cherry picked from commit 288eb61a173ce6f4cdf0be0d744c9c6b6b5598a4)
2020-06-10 09:51:37 -04:00
Domen Kožar
aa0b0e705f Merge pull request #104 from mkoloberdin/master
tests: Do not exit on an expected failure code.
2020-06-03 23:21:11 +02:00
Thomas Holder
6e5e98ce77 Consistently use --force-rpath (fixes #94) 2020-06-03 13:37:13 +02:00
Dan L. Stahlke
71ed440127 Added --output flag 2020-06-01 12:12:54 -07:00
am813nt
a6e524c418 Fixed tests to be running with parallel-tests 2017-08-02 16:57:33 +05:00
Michael Koloberdin
ceafc00e88 tests: Do not exit on an expected failure code.
The comment in the code below the patched line
clearly suggests that it should go on in this case.
This condition occurs on Alpine Linux (musl-libc-based):
http://patchwork.alpinelinux.org/patch/2206/
2016-07-10 03:53:01 +03:00
Tuomas Tynkkynen
4814341494 Add '--allowed-rpath-prefixes' option to '--shrink-rpath'
Fixes #97. In essence, the problem is that some packages in Nixpkgs have
RPATHs pointing to both $NIX_BUILD_TOP and $out, e.g.:

/tmp/nix-build-openldap-2.4.44.drv-0/openldap-2.4.44/libraries/libldap_r/.libs
/tmp/nix-build-openldap-2.4.44.drv-0/openldap-2.4.44/libraries/liblber/.libs
/nix/store/bfkmdxmv3a3f0g3d2q8jkdz2wam93c5z-openldap-2.4.44/lib
/nix/store/bfkmdxmv3a3f0g3d2q8jkdz2wam93c5z-openldap-2.4.44/lib64

Currently, running `patchelf --shrink-rpath` does the wrong thing by
keeping the /tmp/ paths and deleting the /nix/store ones. Now we can fix
the problem by using

patchelf --shrink-rpath --allowed-rpath-prefixes $NIX_STORE_DIR

in the Nixpkgs fixupPhase instead.
2016-06-04 00:25:02 +03:00
Felipe Sateler
bb04c06a66 no-rpath-prebuild: force pagesize to 4096 on prebuilt binaries
They all have that page size, and the host-detected one might be
different.
2016-02-29 17:38:07 -03:00
Eelco Dolstra
b202ad239e PR #40 had the side-effect of fixing the ia64 test 2015-07-24 01:36:39 +02:00
darealshinji
d4720dcb72 soname test: set an initial DT_SONAME entry 2015-07-13 19:54:30 +02:00
darealshinji
453660e7db tests: build libsimple without soname 2015-07-13 19:53:38 +02:00
Eelco Dolstra
bf4b579d63 Fix build on Linux
http://hydra.nixos.org/build/13337912
2014-08-18 12:40:05 +02:00
Eelco Dolstra
2ca39b8060 no-rpath-prebuild.sh: Don't run resulting binary
This leads to numerous build failures:

  http://hydra.nixos.org/eval/1136585

because ELF interpreter names are not unique (e.g. ld-linux.so.2 is
used on systems other than i686-linux).
2014-07-18 12:40:15 +02:00
Eelco Dolstra
1090b56a0a Merge branch 'master' of github.com:vdanjean/patchelf
Conflicts:
	tests/Makefile.am
2014-04-24 16:58:45 +02:00
Chingis Dugarzhapov
02c185ff69 Added tests for --print-soname and --set-soname 2014-04-19 10:05:56 +00:00
Vincent Danjean
c4220eaf0f rewrite no-rpath test
* compile locally this test in the no-rpath test
* add tests for prebuilt no-rpath binaries on various ELF platforms
  => ia64 does not work, probably a bug in patchelf. Marking it as XFAIL for now
2012-07-11 10:10:32 +02:00
Vincent Danjean
00b2fa4f77 Rewrite tests in automake
- add options in AM_INIT_AUTOMAKE to be more strict
  and to enable more advanced features (color-tests and parallel-tests)
- rewrite tests/Makefile.am to use automake rules for building program and libraries

=> we can now do:
./bootstrap.sh && mkdir build && cd build && ../configure && make -j distcheck
2012-07-10 18:16:24 -04:00
Vincent Danjean
3226dea361 Allow parallel execution of tests
Each test use its own subdirectory in scratch/
2012-07-10 18:16:24 -04:00
Vincent Danjean
4f66601450 fix build *and check* out of tree
- use Makefile variables $< (and $@) so that sources are found correctly
- use ${srcdir} in test scripts to find the sources

This allows "make distcheck" to successfully pass
2012-07-10 18:16:24 -04:00
Vincent Danjean
102237983e Rewrite tests in automake
- add options in AM_INIT_AUTOMAKE to be more strict
  and to enable more advanced features (color-tests and parallel-tests)
- rewrite tests/Makefile.am to use automake rules for building program and libraries

=> we can now do:
./bootstrap.sh && mkdir build && cd build && ../configure && make -j distcheck
2012-06-21 11:50:48 +02:00
Vincent Danjean
8d6a477b99 Allow parallel execution of tests
Each test use its own subdirectory in scratch/
2012-06-21 11:43:57 +02:00
Vincent Danjean
a479665158 fix build *and check* out of tree
- use Makefile variables $< (and $@) so that sources are found correctly
- use ${srcdir} in test scripts to find the sources

This allows "make distcheck" to successfully pass
2012-06-21 10:03:31 +02:00
Eelco Dolstra
2b52ef1cdc * Test whether the patched no-rpath executable works on i686-linux. 2010-08-26 11:36:31 +00:00
Eelco Dolstra
3955ec926c * On FreeBSD, running a program by calling the ELF interpreter
directly (e.g. “/libexec/ld-elf.so.1 /bin/ls”) hangs, and on OpenBSD
  the interpreter is not executable.  Let’s assume that it only works
  on Linux.
2009-11-04 15:26:57 +00:00
Eelco Dolstra
ecb2b0c96f * Regression test for NIXPKGS-98: patchelf barfs on dynamic libraries
that contain an .interp section.
2009-06-16 15:26:30 +00:00
Eelco Dolstra
fbaddb9b47 * Regression test: Doing "/lib/ld-linux-x86-64.so.2 <program>" should
work on a patched executable (it doesn't right now on x86_64).
2009-01-30 13:49:58 +00:00
Eelco Dolstra
0500f6d677 2008-05-28 15:50:07 +00:00
Eelco Dolstra
ef42c45d0c * Fix a broken test. 2008-05-28 15:32:03 +00:00
Eelco Dolstra
94886c4baf * Fix make dist. 2008-05-28 14:39:10 +00:00
Eelco Dolstra
dd00c21227 * A test for setting the rpath on a library. 2008-05-28 12:29:23 +00:00
Eelco Dolstra
704c22c6a8 * Support DT_RUNPATH (in fact, prefer DT_RUNPATH over DT_RPATH unless
--force-rpath is set).
2008-05-27 16:23:21 +00:00
Eelco Dolstra
26f47987c5 * Fix the tests on FreeBSD. On FreeBSD, the RPATH is scoped: adding a
directory to the RPATH of an executable doesn't cause it to be used
  for resolving dependencies of libraries, only the dependencies of
  the executable itself.  So don't rely on that.  A better fix would
  be to support --set-rpath on libraries, but that's a lot harder.
2008-05-09 15:46:54 +00:00
Eelco Dolstra
94f38d26bc * .rel.plt is called .rela.plt on x86_64-linux. 2007-01-31 15:08:42 +00:00
Eelco Dolstra
56cae84500 * Instantiate the right template depending on whether the file is 32
or 64 bits.  (This is done at runtime, so patchelf can patch 32
  *and* 64-bit executables on both 32 and 64-bit platforms).
2007-01-31 14:48:19 +00:00
Eelco Dolstra
c246daeeea * --interpreter' -> --set-interpreter'. 2005-10-11 13:05:08 +00:00
Eelco Dolstra
37cd5c8d04 * A `--debug' flag. 2005-10-04 13:11:16 +00:00
Eelco Dolstra
b60d8d3ef2 * Add a test for programs that crash when .dynstr etc. are moved. 2005-10-03 18:22:32 +00:00
Eelco Dolstra
dd77b20708 * Handle the case where no RPATH is present, so the .dynamic table has
to be increased.
2005-10-01 01:05:50 +00:00
Eelco Dolstra
2369d8b2de * Handle `--set-rpath' for the growing case. 2005-09-30 23:59:40 +00:00
Eelco Dolstra
58ec67927f * `patchelf --set-rpath': short case. 2005-09-30 23:04:25 +00:00
Eelco Dolstra
d5afac8e03 * Revert. 2005-09-30 21:28:34 +00:00
Eelco Dolstra
460e117720 * Refactoring continued: `--set-interpreter' works again. 2005-09-30 21:22:27 +00:00
Eelco Dolstra
1587dc98e2 * Doh! 2005-09-30 15:44:47 +00:00
Eelco Dolstra
774bdc0d5e * Also try a interpreter with a long name. 2005-09-30 15:43:10 +00:00
Eelco Dolstra
8d7076e8cf * Set a interpreter with a short name. 2005-09-30 15:38:42 +00:00
Eelco Dolstra
5349440827 * C++-ify. 2005-09-30 11:40:20 +00:00