mirror of
https://github.com/rui314/mold.git
synced 2024-11-11 16:58:12 +03:00
46 lines
914 B
Bash
Executable File
46 lines
914 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 | cc -o $t/a.o -c -xc -
|
|
#include <stdio.h>
|
|
|
|
int main() {
|
|
printf("Hello world\n");
|
|
return 0;
|
|
}
|
|
EOF
|
|
|
|
../mold -pie -o $t/exe \
|
|
-dynamic-linker /lib64/ld-linux-x86-64.so.2 \
|
|
/usr/lib/x86_64-linux-gnu/Scrt1.o \
|
|
/usr/lib/x86_64-linux-gnu/crti.o \
|
|
/usr/lib/gcc/x86_64-linux-gnu/10/crtbeginS.o \
|
|
-L/usr/lib/gcc/x86_64-linux-gnu/10 \
|
|
-L/usr/lib/x86_64-linux-gnu \
|
|
-L/usr/lib64 \
|
|
-L/lib/x86_64-linux-gnu \
|
|
-L/lib64 \
|
|
-L/usr/lib/x86_64-linux-gnu \
|
|
-L/usr/lib64 \
|
|
-L/usr/lib64 \
|
|
-L/usr/lib \
|
|
-L/usr/lib/llvm-10/lib \
|
|
-L/lib \
|
|
-L/usr/lib \
|
|
/home/ruiu/mold/test/tmp/pie/a.o \
|
|
-lgcc \
|
|
-lgcc_s \
|
|
-lc \
|
|
-lgcc \
|
|
-lgcc_s \
|
|
/usr/lib/gcc/x86_64-linux-gnu/10/crtendS.o \
|
|
/usr/lib/x86_64-linux-gnu/crtn.o
|
|
|
|
$t/exe | grep -q 'Hello world'
|
|
|
|
echo OK
|