File tree Expand file tree Collapse file tree 3 files changed +53
-1
lines changed Expand file tree Collapse file tree 3 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 11name : Publish
22on :
3+ workflow_dispatch :
4+ inputs :
5+ enable_stress_test :
6+ description : " Run pachelf on all binaries in the image"
7+ type : boolean
8+ default : false
39 pull_request :
410 push :
511 branches :
8995 rm -f dist/*
9096 cd patchelf-*
9197 ./configure --prefix /patchelf
92- make check || (cat tests/test-suite.log; exit 1)
98+ make check STRESS=${{ inputs.enable_stress_test }} || (cat tests/test-suite.log; exit 1)
9399 make install-strip
94100 cd -
95101 tar -czf ./dist/patchelf-\$(cat patchelf-*/version)-\$(uname -m).tar.gz -C /patchelf .
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ src_TESTS = \
4949 modify-execstack.sh \
5050 rename-dynamic-symbols.sh \
5151 overlapping-segments-after-rounding.sh \
52+ stress.sh \
5253 empty-note.sh
5354
5455build_TESTS = \
Original file line number Diff line number Diff line change 1+ #! /bin/sh -e
2+
3+ [ " $STRESS " = " 1" ] || exit 0
4+
5+ SCRATCH=scratch/$( basename " $0 " .sh)
6+ PATCHELF=$( readlink -f " ../src/patchelf" )
7+
8+ rm -rf " ${SCRATCH} "
9+ mkdir -p " ${SCRATCH} "
10+ cd " ${SCRATCH} "
11+
12+ for lib in /usr/lib* /* .so* /usr/bin/* /usr/libexec/*
13+ do
14+ if file " $lib " | grep -q -e " ELF.*dynamically"
15+ then
16+ echo " ==============================================================="
17+ echo " #### Copying"
18+ echo " $lib "
19+ echo " $( file $lib ) "
20+ blib=" $( basename " $lib " ) "
21+ cp " $lib " " $blib "
22+ echo " #### chmod"
23+ chmod +w " $blib "
24+
25+ echo " #### readelf before"
26+ readelf -L " $blib " > /dev/null 2> re_before || echo
27+ echo " #### ldd before"
28+ ldd " $blib " | sed ' s/0x.*//g' > ldd_before
29+
30+ echo " #### get rpath"
31+ new_rpath=" $( ${PATCHELF} --print-rpath " $blib " ) :XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
32+ echo " #### new rpath: $new_rpath "
33+ ${PATCHELF} --force-rpath --set-rpath " $new_rpath " " $blib "
34+
35+ echo " #### readelf after"
36+ readelf -L " $blib " > /dev/null 2> re_after || echo
37+ echo " #### ldd after"
38+ ldd " $blib " | sed ' s/0x.*//g' > ldd_after
39+
40+ diff re_before re_after
41+ diff ldd_before ldd_after
42+
43+ rm " $blib "
44+ fi
45+ done
You can’t perform that action at this time.
0 commit comments