mirror of
https://github.com/NixOS/patchelf.git
synced 2025-10-18 17:42:36 +08:00
grow-test: fix on non-gcc systems
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -31,3 +31,4 @@ Makefile
|
||||
/tests/main-scoped
|
||||
/tests/libbig-dynstr.debug
|
||||
/tests/contiguous-note-sections
|
||||
/tests/simple-pie
|
||||
|
@@ -2,7 +2,7 @@ LIBS =
|
||||
|
||||
STRIP ?= strip
|
||||
|
||||
check_PROGRAMS = simple main too-many-strtab main-scoped big-dynstr no-rpath contiguous-note-sections
|
||||
check_PROGRAMS = simple-pie simple main too-many-strtab main-scoped big-dynstr no-rpath contiguous-note-sections
|
||||
|
||||
no_rpath_arch_TESTS = \
|
||||
no-rpath-amd64.sh \
|
||||
@@ -68,6 +68,9 @@ simple_SOURCES = simple.c
|
||||
# no -fpic for simple.o
|
||||
simple_CFLAGS =
|
||||
|
||||
simple_pie_SOURCES = simple.c
|
||||
simple_pie_CFLAGS = -fPIC -pie
|
||||
|
||||
main_SOURCES = main.c
|
||||
main_LDADD = -lfoo $(AM_LDADD)
|
||||
main_DEPENDENCIES = libfoo.so
|
||||
|
@@ -5,12 +5,12 @@ SCRATCH=scratch/$(basename $0 .sh)
|
||||
rm -rf ${SCRATCH}
|
||||
mkdir -p ${SCRATCH}
|
||||
|
||||
g++ -x c -fPIC -pie -o ${SCRATCH}/simple simple.c
|
||||
cp simple-pie ${SCRATCH}/simple-pie
|
||||
|
||||
# Add a 40MB rpath
|
||||
head -c 40000000 /dev/urandom > ${SCRATCH}/foo.bin
|
||||
|
||||
# Grow the file
|
||||
../src/patchelf --add-rpath @${SCRATCH}/foo.bin ${SCRATCH}/simple
|
||||
../src/patchelf --add-rpath @${SCRATCH}/foo.bin ${SCRATCH}/simple-pie
|
||||
# Make sure we can still run it
|
||||
${SCRATCH}/simple
|
||||
${SCRATCH}/simple-pie
|
||||
|
Reference in New Issue
Block a user