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

--- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> ---
Note I get

                        7: R_X86_64_GOTOFF64    _GLOBAL_OFFSET_TABLE_-0x4

when I use both as 2.37 and 2.39 with the output provided by gcc-12 -fPIC:

$ cat foo.s
        .file   "pr106834.c"
        .text
        .section        .rodata
.LC0:
        .string "%lx"
        .text
        .globl  main
        .type   main, @function
main:
.LFB0:
        .cfi_startproc
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset 6, -16
        movq    %rsp, %rbp
        .cfi_def_cfa_register 6
        movq    _GLOBAL_OFFSET_TABLE_@GOTPCREL(%rip), %rax
        movq    %rax, %rsi
        leaq    .LC0(%rip), %rax
        movq    %rax, %rdi
        movl    $0, %eax
        call    printf@PLT
        movl    $0, %eax
        popq    %rbp
        .cfi_def_cfa 7, 8
        ret
        .cfi_endproc
.LFE0:
        .size   main, .-main
        .ident  "GCC: (SUSE Linux) 12.2.1 20220830 [revision
e927d1cf141f221c5a32574bde0913307e140984]"
        .section        .note.GNU-stack,"",@progbits

while using the assembly from Comment 3 I get:
                        b: R_X86_64_GOTPC32     _GLOBAL_OFFSET_TABLE_-0x4

for both as versions.

Reply via email to