File tree Expand file tree Collapse file tree 6 files changed +17
-13
lines changed Expand file tree Collapse file tree 6 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ AM_INIT_AUTOMAKE([1.11.1 -Wall -Werror dist-bzip2 foreign color-tests parallel-t
6
6
AC_CONFIG_MACRO_DIR ( [ m4] )
7
7
8
8
AC_CHECK_TOOL ( [ STRIP] , [ strip] )
9
+ # Those are only used in tests, hence we gracefully degrate if they are not found.
10
+ AC_CHECK_TOOL ( [ OBJDUMP] , [ objdump] , [ objdump] )
11
+ AC_CHECK_TOOL ( [ OBJCOPY] , [ objcopy] , [ objcopy] )
12
+ AC_CHECK_TOOL ( [ READELF] , [ readelf] , [ readelf] )
9
13
10
14
AM_PROG_CC_C_O
11
15
AC_PROG_CXX
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ TESTS = $(src_TESTS) $(build_TESTS)
52
52
53
53
EXTRA_DIST = no-rpath-prebuild $(src_TESTS ) no-rpath-prebuild.sh invalid-elf endianness empty-note
54
54
55
- TESTS_ENVIRONMENT = PATCHELF_DEBUG=1
55
+ TESTS_ENVIRONMENT = PATCHELF_DEBUG=1 OBJDUMP= $( OBJDUMP ) READELF= $( READELF )
56
56
57
57
$(no_rpath_arch_TESTS ) : no-rpath-prebuild.sh
58
58
@ln -s $< $@
Original file line number Diff line number Diff line change 1
1
#! /bin/sh -e
2
2
SCRATCH=scratch/$( basename $0 .sh)
3
+ READELF=${READELF:- readelf}
3
4
4
5
rm -rf ${SCRATCH}
5
6
mkdir -p ${SCRATCH}
6
7
7
8
cp libsimple.so ${SCRATCH} /
8
9
9
10
# check there is no DT_DEBUG tag
10
- debugTag=$( readelf -d ${SCRATCH} /libsimple.so)
11
+ debugTag=$( $READELF -d ${SCRATCH} /libsimple.so)
11
12
echo " .dynamic before: $debugTag "
12
13
if echo " $debugTag " | grep -q DEBUG; then
13
14
echo " failed --add-debug-tag test. Expected no line with (DEBUG), got: $debugTag "
18
19
../src/patchelf --add-debug-tag ${SCRATCH} /libsimple.so
19
20
20
21
# check there is DT_DEBUG tag
21
- debugTag=$( readelf -d ${SCRATCH} /libsimple.so)
22
+ debugTag=$( $READELF -d ${SCRATCH} /libsimple.so)
22
23
echo " .dynamic before: $debugTag "
23
24
if ! echo " $debugTag " | grep -q DEBUG; then
24
25
echo " failed --add-debug-tag test. Expected line with (DEBUG), got: $debugTag "
Original file line number Diff line number Diff line change 1
1
#! /bin/sh -e
2
2
SCRATCH=scratch/$( basename $0 .sh)
3
-
4
- if ! command -v readelf > /dev/null; then
5
- echo " No readelf found; skip test"
6
- exit 0
7
- fi
3
+ READELF=${READELF:- readelf}
8
4
9
5
rm -rf " ${SCRATCH} "
10
6
mkdir -p " ${SCRATCH} "
Original file line number Diff line number Diff line change 1
1
#! /bin/sh -e
2
2
SCRATCH=scratch/$( basename $0 .sh)
3
+ OBJDUMP=${OBJDDUMP:- objdump}
3
4
4
5
rm -rf ${SCRATCH}
5
6
mkdir -p ${SCRATCH}
@@ -13,7 +14,7 @@ doit() {
13
14
}
14
15
15
16
expect () {
16
- out=$( echo $( objdump -x $SCRATCHFILE | grep PATH) )
17
+ out=$( echo $( $OBJDUMP -x $SCRATCHFILE | grep PATH) )
17
18
18
19
if [ " $out " != " $* " ]; then
19
20
echo " Expected '$* ' but got '$out '"
Original file line number Diff line number Diff line change 1
1
#! /bin/sh -e
2
2
3
- if ! objdump -p main | grep -q MIPS_RLD_MAP_REL; then
3
+ SCRATCH=scratch/$( basename $0 .sh)
4
+ OBJDUMP=${OBJDUMP:- objdump}
5
+ OBJCOPY=${OBJCOPY:- objcopy}
6
+
7
+ if ! $OBJDUMP -p main | grep -q MIPS_RLD_MAP_REL; then
4
8
echo " No MIPS_RLD_MAP_REL dynamic section entry, skipping"
5
9
exit 0
6
10
fi
7
11
8
- SCRATCH=scratch/$( basename $0 .sh)
9
-
10
12
rm -rf ${SCRATCH}
11
13
mkdir -p ${SCRATCH}
12
14
mkdir -p ${SCRATCH} /libsA
@@ -17,7 +19,7 @@ cp libfoo.so ${SCRATCH}/libsA/
17
19
cp libbar.so ${SCRATCH} /libsB/
18
20
19
21
# break the main executable by removing .rld_map section
20
- objcopy --remove-section .rld_map ${SCRATCH} /main
22
+ ${OBJCOPY} --remove-section .rld_map ${SCRATCH} /main
21
23
22
24
oldRPath=$( ../src/patchelf --print-rpath ${SCRATCH} /main)
23
25
if test -z " $oldRPath " ; then oldRPath=" /oops" ; fi
You can’t perform that action at this time.
0 commit comments