File tree Expand file tree Collapse file tree 7 files changed +28
-0
lines changed Expand file tree Collapse file tree 7 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ src_TESTS = \
2828 no-rpath-pie-powerpc.sh \
2929 build-id.sh \
3030 invalid-elf.sh \
31+ endianness.sh \
3132 contiguous_note_sections.sh
3233
3334build_TESTS = \
Original file line number Diff line number Diff line change 1+ #! /bin/sh -e
2+ SCRATCH=scratch/$( basename $0 .sh)
3+ PATCHELF=" ../src/patchelf"
4+
5+ for arch in ppc64 ppc64le; do
6+ rm -rf ${SCRATCH}
7+ mkdir -p ${SCRATCH}
8+
9+ cp endianness/${arch} /main endianness/${arch} /libtest.so ${SCRATCH} /
10+
11+ rpath=" ${PWD} /${SCRATCH} "
12+
13+ # set rpath to scratch dir
14+ ${PATCHELF} --output ${SCRATCH} /main-rpath --set-rpath $rpath ${SCRATCH} /main
15+
16+ # attempt to shrink rpath, should not result in empty rpath
17+ ${PATCHELF} --output ${SCRATCH} /main-shrunk --shrink-rpath --debug ${SCRATCH} /main-rpath
18+
19+ # check whether rpath is still present
20+ if ! ${PATCHELF} --print-rpath ${SCRATCH} /main-shrunk | grep -q " $rpath " ; then
21+ echo " rpath was removed for ${arch} "
22+ exit 1
23+ fi
24+ done
Original file line number Diff line number Diff line change 1+ all :
2+ $(CC ) -xc -nostdlib -shared -o libtest.so - <<< ' void test() {}'
3+ $(CC ) -xc -nostdlib -L. -ltest -o main - <<< ' void _start() {}'
You can’t perform that action at this time.
0 commit comments