diff options
author | Andrew Laucius <andrewla@gmail.com> | 2021-09-10 18:58:44 +0000 |
---|---|---|
committer | Andrew Laucius <andrewla@gmail.com> | 2021-09-13 15:00:44 +0000 |
commit | a4ae03d638e4a20d89cfeb2fae3bdfeccd366d16 (patch) | |
tree | 62fdfbfee5cd817135d402fa2764a4f93eb3f1e8 | |
parent | de5354f3720b827a68e4abc99d6f7a9aacb31407 (diff) | |
download | patchelf-a4ae03d638e4a20d89cfeb2fae3bdfeccd366d16.tar.gz |
New test for growing the file
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rwxr-xr-x | tests/grow-file.sh | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 135ae4f..1722387 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -35,6 +35,7 @@ src_TESTS = \ endianness.sh \ contiguous-note-sections.sh \ no-gnu-hash.sh \ + grow-file.sh \ no-dynamic-section.sh \ args-from-file.sh \ basic-flags.sh \ diff --git a/tests/grow-file.sh b/tests/grow-file.sh new file mode 100755 index 0000000..40e0455 --- /dev/null +++ b/tests/grow-file.sh @@ -0,0 +1,16 @@ +#! /bin/sh -e + +SCRATCH=scratch/$(basename $0 .sh) + +rm -rf ${SCRATCH} +mkdir -p ${SCRATCH} + +g++ -x c -fPIC -pie -o ${SCRATCH}/simple simple.c + +# Add a 40MB rpath +head -c 40000000 /dev/urandom > ${SCRATCH}/foo.bin + +# Grow the file +../src/patchelf --add-rpath @${SCRATCH}/foo.bin ${SCRATCH}/simple +# Make sure we can still run it +${SCRATCH}/simple |