Skip to content

Commit 81f59ad

Browse files
committed
Add test for setting interpreter on debug-only executable
1 parent 523f401 commit 81f59ad

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

tests/Makefile.am

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ src_TESTS = \
5353
shared-rpath.sh \
5454
short-first-segment.sh \
5555
empty-note.sh \
56-
set-interpreter-same.sh
56+
set-interpreter-same.sh \
57+
debug-interp.sh
5758

5859
build_TESTS = \
5960
$(no_rpath_arch_TESTS)

tests/debug-interp.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#! /bin/sh -e
2+
SCRATCH=scratch/$(basename "$0" .sh)
3+
OBJCOPY=${OBJCOPY:-objcopy}
4+
5+
rm -rf "${SCRATCH}"
6+
mkdir -p "${SCRATCH}"
7+
8+
cp simple "${SCRATCH}/"
9+
10+
${OBJCOPY} --only-keep-debug "${SCRATCH}/simple" "${SCRATCH}/simple.debug"
11+
12+
# Check if patchelf handles debug-only executables
13+
../src/patchelf --set-interpreter /oops "${SCRATCH}/simple.debug"

0 commit comments

Comments
 (0)