https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120653

--- Comment #17 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Jakub Jelinek from comment #14)
> Seems _dl_start_final is in this configuration inlined into _dl_start and
> the important difference is (-fstrict-aliasing to -fno-strict-aliasing):
> @@ -1206,11 +1207,8 @@ _dl_start:
>         pushq   %rbp
>         .cfi_def_cfa_offset 16
>         .cfi_offset 6, -16
> -       leaq    __ehdr_start(%rip), %rsi

This doesn't need run-time relocation.

>         leaq    _end(%rip), %rax
> -       movq    %rsi, %xmm2
>         movq    %rax, %xmm3
> -       punpcklqdq      %xmm3, %xmm2
>         movq    %rsp, %rbp
>         .cfi_def_cfa_register 6
>         pushq   %r15
> @@ -1225,214 +1223,176 @@ _dl_start:
>         .cfi_offset 12, -48
>         .cfi_offset 3, -56
>         movq    %rdi, -136(%rbp)
> +       movq    .LC31(%rip), %xmm2
> +       punpcklqdq      %xmm3, %xmm2
>         movaps  %xmm2, -128(%rbp)
>         rdtsc
> +       leaq    __ehdr_start(%rip), %rdi
>         andb    $-33, 854+_dl_rtld_map(%rip)
> -       leaq    64+_dl_rtld_map(%rip), %rcx
> -       movl    $1879048191, %r8d
> -       movl    $1879048233, %r9d
> +       movq    %rdi, _dl_rtld_map(%rip)
>         salq    $32, %rdx
> -       movq    %rsi, _dl_rtld_map(%rip)
>         orq     %rdx, %rax
>         leaq    _DYNAMIC(%rip), %rdx
>         movq    %rax, start_time(%rip)
>         movq    _DYNAMIC(%rip), %rax
> ...
> @@ -6289,9 +6296,13 @@ _rtld_global_ro:
>         .globl  _rtld_local_ro
>         .hidden _rtld_local_ro
>         .set    _rtld_local_ro,_rtld_global_ro
> +       .section        .data.rel.ro.local
> +       .align 8
> +.LC31:
> +       .quad   __ehdr_start

This requires the run-time relocation. This is another case of PR 103762.

Reply via email to