https://sourceware.org/bugzilla/show_bug.cgi?id=30226
Bug ID: 30226 Summary: CTF deduplication is incompatible with -femit-struct-debug-detailed=base Product: binutils Version: 2.36 Status: NEW Severity: normal Priority: P2 Component: libctf Assignee: unassigned at sourceware dot org Reporter: nick.alcock at oracle dot com Target Milestone: --- Minimal reproducer: [ibhagat@ibhagatpc final2]$ cat t.i # 8 "" typedef struct { union { int addr4; int addr6[4]; } u_ipaddr; } KS_IPADDR; KS_IPADDR KsSockOp_KsSockOp_op; [ibhagat@ibhagatpc final2]$ rm -rf t.o; gcc -gctf -g -g -O2 -femit-struct-debug-detailed=base -o t.o -c t.i; ld -r -o temp_t.o t.o; CTF error: /home/ibhagat/data1/gcc-temp/stacktrace/ctf/dbgrid/final2/ (0): while emitting deduplicated forward, error emitting target type from input type 1 CTF error: deduplicating link type emission failed for /home/ibhagat/data1/gcc-temp/stacktrace/ctf/dbgrid/final2/ ld: warning: CTF linking failed; output will have no CTF section: Type name must not be empty. This is because this option causes the emission of a typedef pointing to a forward with no name, which is a bizarre artifact that is impossible to write in plain C and which libctf prohibits the creation of: 0x1: (kind 9) struct 0x2: (kind 10) KS_IPADDR -> 0x1: (kind 9) struct The deduplicator does its job and tries to emit this thing into the output, and fails because it makes no sense. This is a good thing because had it worked the result would have been wrong: all those empty structs would have been considered identical and merged together, but in fact they should only be considered identical to other struct KS_IPADDRs. -- You are receiving this mail because: You are on the CC list for the bug.