1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-05 17:17:40 +03:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Muhammad Mominul Huque
706f88cbb3
Merge f05e32df4a into b145377c39 2024-07-02 11:12:25 +03:00
Rui Ueyama
b145377c39
Merge pull request #1296 from marxin/improve-gdb-index-test
Improve --gdb-index test by using readelf --debug=gdb_index
2024-07-01 17:15:51 +09:00
Martin Liska
08f2a74be7 Improve --gdb-index test by using readelf --debug=gdb_index 2024-06-30 16:07:47 +02:00
Muhammad Mominul Huque
f05e32df4a
Update README.md
GCC doesn't accept a path as an argument to `-fuse-ld`. `-fuse-ld=mold` is enough.

Tested with
```
gcc (GCC) 13.2.1 20231205 (Red Hat 13.2.1-6)
```
2023-12-31 18:21:30 +06:00
2 changed files with 4 additions and 1 deletions

View File

@ -133,7 +133,7 @@ may be able to remove the `linker = "clang"` line.
```toml
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-arg=-fuse-ld=/path/to/mold"]
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
```
If you want to use mold for all projects, add the above snippet to

View File

@ -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
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
void fn1();
@ -76,6 +78,7 @@ EOF
$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 --debug=gdb_index $t/exe 2> /dev/null | grep -q 'main: .* \[global, function\]'
$QEMU $t/exe | grep -q 'Hello world'