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

            Bug ID: 33765
           Summary: Slow Rust link with -pie -z pack-relative-relocs
           Product: binutils
           Version: 2.45
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: sam at gentoo dot org
  Target Milestone: ---

Linking amdgpu_top (a Rust application) with bfd is very slow. It seems to be
the combination of -pie -z pack-relative-relocs.

```
$ time ld -pie -z pack-relative-relocs --eh-frame-hdr -m elf_x86_64 Scrt1.o
crti.o crtbeginS.o
amdgpu_top-a797a75eb19ad674.amdgpu_top.6162e9ef1383e27f-cgu.0.rcgu.o -L.
-Bstatic libcompiler_builtins-e2a93e358f074ed3.rlib -Bdynamic -ldl -ldl -ldrm
-ldrm_amdgpu -lgcc_s -lutil -lrt -lpthread -lm -ldl -lc --eh-frame-hdr
crtendS.o crtn.o -o amdgpu_top-a797a75eb19ad674

real    19m40.900s
user    16m26.492s
sys     3m5.661s

```

Without -z pack-relative-relocs:
```
+ ld -pie --eh-frame-hdr -m elf_x86_64 Scrt1.o crti.o crtbeginS.o
amdgpu_top-a797a75eb19ad674.amdgpu_top.6162e9ef1383e27f-cgu.0.rcgu.o -L.
-Bstatic libcompiler_builtins-e2a93e358f074ed3.rlib -Bdynamic -ldl -ldl -ldrm
-ldrm_amdgpu -lgcc_s -lutil -lrt -lpthread -lm -ldl -lc --eh-frame-hdr
crtendS.o crtn.o -o amdgpu_top-a797a75eb19ad674

real    0m3.489s
user    0m2.308s
sys     0m1.168s
```

Without -pie:
```
+ ld -z pack-relative-relocs --eh-frame-hdr -m elf_x86_64 Scrt1.o crti.o
crtbeginS.o
amdgpu_top-a797a75eb19ad674.amdgpu_top.6162e9ef1383e27f-cgu.0.rcgu.o -L.
-Bstatic libcompiler_builtins-e2a93e358f074ed3.rlib -Bdynamic -ldl -ldl -ldrm
-ldrm_amdgpu -lgcc_s -lutil -lrt -lpthread -lm -ldl -lc --eh-frame-hdr
crtendS.o crtn.o -o amdgpu_top-a797a75eb19ad674

real    0m3.378s
user    0m2.149s
sys     0m1.211s
```

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

Reply via email to