https://sourceware.org/bugzilla/show_bug.cgi?id=24406
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|FIXED |---
Status|RESOLVED |REOPENED
CC| |rguenth at gcc dot gnu.org
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
Just to note with BFD ld from 2.41.0 I see
1
a-t.o 3
194 b4b00c6ef6ad050b PREVAILING_DEF_IRONLY __wrap_cook
198 b4b00c6ef6ad050b PREVAILING_DEF main
214 b4b00c6ef6ad050b RESOLVED_IR cook
when building
int cook(void);
int __wrap_cook(void)
{
return 0;
}
int main()
{
if (cook () == -1)
__builtin_abort ();
return 0;
}
but an LTO link fails with
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld:
./a.ltrans0.ltrans.o: in function `main':
<artificial>:(.text+0x10): undefined reference to `__wrap_cook'
GCC emits at LTRANS stage
.file "<artificial>"
.text
.type __wrap_cook, @function
__wrap_cook:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size __wrap_cook, .-__wrap_cook
.globl main
.type main, @function
main:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
call cook
cmpl $-1, %eax
jne .L4
call abort
.L4:
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
which I think should be OK. The main difference is that __wrap_cook is
an internal symbol but that's OK since the linker told GCC
194 b4b00c6ef6ad050b PREVAILING_DEF_IRONLY __wrap_cook
it probably should have used
194 b4b00c6ef6ad050b PREVAILING_DEF __wrap_cook
instead.
--
You are receiving this mail because:
You are on the CC list for the bug.