https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119386
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |matz at gcc dot gnu.org
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Franz Sirl from comment #7)
> (In reply to Ard Biesheuvel from comment #5)
> > How did you build this compiler? Is this reproducible with the distro
> > version?
>
> I built this compiler myself on SuSe, but it's the same with the gcc-14
> distro compiler.
> But your question made me curious and I tried it on Fedora41 and there it
> works.
> I checked the assembler files and they are identical. So I guess the Suse
> binutils have a change that causes this behaviour. Adding Richard to CC.
I can confirm this with a self built GCC 14 on 15.6 and
> ld --version
GNU ld (GNU Binutils; SUSE Linux Enterprise 15) 2.43.1.20241209-150100.7.52
Relocation section '.rela.text' at offset 0x128 contains 1 entry:
Offset Info Type Sym. Value Sym. Name +
Addend
000000000009 000400000002 R_X86_64_PC32 0000000000000000 mcount - 4
I'll note that 'mcount' is simply called directly. I have no idea why
that behavior should be distro-specific.
f:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $8, %rsp
1: call mcount
movl %edi, -4(%rbp)