https://sourceware.org/bugzilla/show_bug.cgi?id=16698
maillist-gdb at barfooze dot de changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7638|0 |1 is obsolete| | Attachment #7663|0 |1 is obsolete| | Attachment #7670|0 |1 is obsolete| | Attachment #7671|0 |1 is obsolete| | --- Comment #15 from maillist-gdb at barfooze dot de --- Created attachment 7672 --> https://sourceware.org/bugzilla/attachment.cgi?id=7672&action=edit manually reduced testcase to the bare minimum i manually reduced libc/stdin.c to the following typedef struct _IO_FILE FILE; struct _IO_FILE { int lock; }; static FILE f = { .lock = -1}; FILE *const (stdin) = &f; this construct, compiled with -g triggers the bug in another object that references it in an unused function when linked with -s --gc-sections... for example: typedef struct _IO_FILE FILE; extern FILE *const stdin; typedef struct pcap pcap_t; struct pcap_sf { FILE *rfile; }; struct pcap { struct pcap_sf sf; }; static void unused_func_referencing_stdin(pcap_t *p) { if (p->sf.rfile != (stdin)) (void)fclose(p->sf.rfile); } int pcap_loop(pcap_t *p, int cnt, void* callback, char *user) { } i reduced the testcase again to the bare minimum, it's just 2 files and 2 libc files now with a total of about 20 lines -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils