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 1
1
name : Publish
2
2
on :
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
3
9
pull_request :
4
10
push :
5
11
branches :
89
95
rm -f dist/*
90
96
cd patchelf-*
91
97
./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)
93
99
make install-strip
94
100
cd -
95
101
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 = \
49
49
modify-execstack.sh \
50
50
rename-dynamic-symbols.sh \
51
51
overlapping-segments-after-rounding.sh \
52
+ stress.sh \
52
53
empty-note.sh
53
54
54
55
build_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