mirror of
https://github.com/rui314/mold.git
synced 2024-10-06 01:28:12 +03:00
Merge pull request #252 from sicherha/fix-tests-on-aarch64
Fix test failures on aarch64
This commit is contained in:
commit
3865a10600
@ -8,6 +8,19 @@ mold="$(pwd)/mold"
|
|||||||
t="$(pwd)/out/test/elf/$testname"
|
t="$(pwd)/out/test/elf/$testname"
|
||||||
mkdir -p "$t"
|
mkdir -p "$t"
|
||||||
|
|
||||||
|
case "$(uname -m)" in
|
||||||
|
i386 | i686 | x86_64)
|
||||||
|
base=0x201000
|
||||||
|
;;
|
||||||
|
aarch64)
|
||||||
|
base=0x210000
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo skipped
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
cat <<EOF | cc -o "$t"/a.o -c -x assembler -
|
cat <<EOF | cc -o "$t"/a.o -c -x assembler -
|
||||||
.globl foo, bar
|
.globl foo, bar
|
||||||
foo:
|
foo:
|
||||||
@ -18,14 +31,14 @@ EOF
|
|||||||
|
|
||||||
"$mold" -e foo -static -o "$t"/exe "$t"/a.o
|
"$mold" -e foo -static -o "$t"/exe "$t"/a.o
|
||||||
readelf -e "$t"/exe > "$t"/log
|
readelf -e "$t"/exe > "$t"/log
|
||||||
grep -q 'Entry point address:.*0x201000' "$t"/log
|
grep -q "Entry point address:.*$base" "$t"/log
|
||||||
|
|
||||||
"$mold" -e bar -static -o "$t"/exe "$t"/a.o
|
"$mold" -e bar -static -o "$t"/exe "$t"/a.o
|
||||||
readelf -e "$t"/exe > "$t"/log
|
readelf -e "$t"/exe > "$t"/log
|
||||||
grep -q 'Entry point address:.*0x201008' "$t"/log
|
grep -q "$(printf 'Entry point address:.*0x%x' $((base + 8)))" "$t"/log
|
||||||
|
|
||||||
"$mold" -static -o "$t"/exe "$t"/a.o
|
"$mold" -static -o "$t"/exe "$t"/a.o
|
||||||
readelf -e "$t"/exe > "$t"/log
|
readelf -e "$t"/exe > "$t"/log
|
||||||
grep -q 'Entry point address:.*0x201000' "$t"/log
|
grep -q "Entry point address:.*$base" "$t"/log
|
||||||
|
|
||||||
echo OK
|
echo OK
|
||||||
|
@ -8,8 +8,21 @@ mold="$(pwd)/mold"
|
|||||||
t="$(pwd)/out/test/elf/$testname"
|
t="$(pwd)/out/test/elf/$testname"
|
||||||
mkdir -p "$t"
|
mkdir -p "$t"
|
||||||
|
|
||||||
|
case "$(uname -m)" in
|
||||||
|
i386 | i686 | x86_64)
|
||||||
|
jump=jmp
|
||||||
|
;;
|
||||||
|
aarch64)
|
||||||
|
jump=b
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo skipped
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
cat <<EOF | cc -o "$t"/a.o -c -x assembler -
|
cat <<EOF | cc -o "$t"/a.o -c -x assembler -
|
||||||
foo: jmp 0
|
foo: $jump 0
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<EOF | cc -o "$t"/b.o -c -xc -
|
cat <<EOF | cc -o "$t"/b.o -c -xc -
|
||||||
|
Loading…
Reference in New Issue
Block a user