Skip to content

Commit

Permalink
LoongArch: disable debug sections for test
Browse files Browse the repository at this point in the history
  • Loading branch information
ywgrit committed Aug 3, 2024
1 parent 5bb05f6 commit 3688c43
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/elf/loongarch64_relax-got.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
. $(dirname $0)/common.inc

cat <<'EOF' | $CC -g -o $t/a.o -c -xassembler -
cat <<'EOF' | $CC -o $t/a.o -c -xassembler -
.globl get_sym1, get_sym2, get_sym3, get_sym4, get_sym5
get_sym1:
la.global $a0, sym1
Expand All @@ -25,7 +25,7 @@ get_sym5:
ret
EOF

cat <<EOF | $CC -g -o $t/b.o -c -xassembler -
cat <<EOF | $CC -o $t/b.o -c -xassembler -
.data
.globl sym1, sym2, sym3, sym4, sym5
sym1:
Expand All @@ -40,7 +40,7 @@ sym5:
.word 0xdeadbeef
EOF

cat <<EOF | $CC -g -o $t/c.o -c -xc -
cat <<EOF | $CC -o $t/c.o -c -xc -
#include <stdio.h>
int get_sym1();
Expand All @@ -55,10 +55,10 @@ int main() {
}
EOF

$CC -B. -g -o $t/exe1 $t/a.o $t/b.o $t/c.o -Wl,--no-relax
$CC -B. -o $t/exe1 $t/a.o $t/b.o $t/c.o -Wl,--no-relax
$QEMU $t/exe1 | grep -Eq '^0 ba beef 11beef deadbeef$'

$CC -B. -g -o $t/exe2 $t/a.o $t/b.o $t/c.o
$CC -B. -o $t/exe2 $t/a.o $t/b.o $t/c.o
$QEMU $t/exe2 | grep -Eq '^0 ba beef 11beef deadbeef$'

$OBJDUMP -d $t/exe2 | grep -A2 '<get_sym2>:' | grep -Eq $'pcaddi'

0 comments on commit 3688c43

Please sign in to comment.