1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-21 09:57:18 +03:00
mold/test/compress-debug-sections.sh
2021-05-06 17:20:07 +09:00

23 lines
451 B
Bash
Executable File

#!/bin/bash
set -e
cd $(dirname $0)
echo -n "Testing $(basename -s .sh $0) ... "
t=$(pwd)/tmp/$(basename -s .sh $0)
mkdir -p $t
cat <<EOF | clang -c -g -o $t/a.o -xc -
#include <stdio.h>
int main() {
printf("Hello world\n");
return 0;
}
EOF
clang -fuse-ld=`pwd`/../mold -o $t/exe $t/a.o -Wl,--compress-debug-sections=zlib
dwarfdump $t/exe > $t/log
grep -q '.debug_info SHF_COMPRESSED' $t/log
grep -q '.debug_str SHF_COMPRESSED' $t/log
echo OK