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

--- Comment #7 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

Does it fix #comment1 for you? I don't see any improvement if I apply 4 patches
at
https://inbox.sourceware.org/binutils/[email protected]/raw
against binutils-2.45.

It takes the same 5 seconds after the patch mostly spending in sys:

$ 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    0m5,800s
user    0m2,569s
sys     0m3,216s

`perf record -g` / `perf report` claims is still spends all the time in
`_bfd_elf_gc_mark`:

    98.30%     0.02%  ld.bfd    libbfd-2.45.so        [.] _bfd_elf_gc_mark
            |
             --98.29%--_bfd_elf_gc_mark
                       |
                        --98.28%--_bfd_elf_gc_mark_reloc
                                  _bfd_elf_gc_mark
                                  |
                                   --98.28%--_bfd_elf_gc_mark_reloc
                                             _bfd_elf_gc_mark
                                             |
                                              --98.27%--_bfd_elf_gc_mark_reloc
                                                        _bfd_elf_gc_mark
                                                        _bfd_elf_gc_mark_reloc
                                                        _bfd_elf_gc_mark
   ...

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

Reply via email to