https://sourceware.org/bugzilla/show_bug.cgi?id=33530

--- Comment #10 from Sergei Trofimovich <slyich at gmail dot com> ---
(In reply to Alan Modra from comment #6)
> Alernate patch series starting with
> https://sourceware.org/pipermail/binutils/2025-October/144989.html

Tested with all 4 patches cherry-picked. Observe similar performance
improvement as H.J.'s patches:

$ printf "int f_0() __attribute__ ((section (\".text.0\"))); int f_0() { return
0; };\n" > main.c; for (( i=1; i<20000; i++ )); do printf "int f_$i()
__attribute__ ((section (\".text.$i\"))); int f_$i() { return f_$((i-1))();
};\n"; done >> main.c; printf "int main() { return f_19999(); }" >> main.c; gcc
-O0 -c main.c -o main.o; echo "bfd:"; time gcc main.o -o main -fuse-ld=bfd
-Wl,--gc-sections
bfd:

real    0m0,113s
user    0m0,070s
sys     0m0,043s

(was 5s before patching)

On a real test linking of a large `pandoc` project shrunk from 36s down to 18s
(gold does it in 13s).

Also looks good!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to