mirror of
https://github.com/rui314/mold.git
synced 2024-08-16 16:30:27 +03:00
Improve --gdb-index test by using readelf --debug=gdb_index
This commit is contained in:
parent
82fb10fe26
commit
08f2a74be7
@ -65,6 +65,8 @@ $CC -c -o $t/d.o $t/d.c -fPIC -g -ggnu-pubnames -gdwarf-5 -ffunction-sections
|
|||||||
|
|
||||||
$CC -B. -shared -o $t/e.so $t/a.o $t/b.o $t/c.o $t/d.o -Wl,--gdb-index
|
$CC -B. -shared -o $t/e.so $t/a.o $t/b.o $t/c.o $t/d.o -Wl,--gdb-index
|
||||||
readelf -WS $t/e.so 2> /dev/null | grep -Fq .gdb_index
|
readelf -WS $t/e.so 2> /dev/null | grep -Fq .gdb_index
|
||||||
|
readelf --debug=gdb_index $t/e.so 2> /dev/null | grep -q 'fn1: .* \[global, function\]'
|
||||||
|
readelf --debug=gdb_index $t/e.so 2> /dev/null | grep -q 'char: .* \[static, type\]'
|
||||||
|
|
||||||
cat <<EOF | $CC -c -o $t/f.o -fPIC -g -ggnu-pubnames -gdwarf-5 -xc - -gz
|
cat <<EOF | $CC -c -o $t/f.o -fPIC -g -ggnu-pubnames -gdwarf-5 -xc - -gz
|
||||||
void fn1();
|
void fn1();
|
||||||
@ -76,6 +78,7 @@ EOF
|
|||||||
|
|
||||||
$CC -B. -o $t/exe $t/e.so $t/f.o -Wl,--gdb-index
|
$CC -B. -o $t/exe $t/e.so $t/f.o -Wl,--gdb-index
|
||||||
readelf -WS $t/exe 2> /dev/null | grep -Fq .gdb_index
|
readelf -WS $t/exe 2> /dev/null | grep -Fq .gdb_index
|
||||||
|
readelf --debug=gdb_index $t/exe 2> /dev/null | grep -q 'main: .* \[global, function\]'
|
||||||
|
|
||||||
$QEMU $t/exe | grep -q 'Hello world'
|
$QEMU $t/exe | grep -q 'Hello world'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user