I attempted to build the kernel with -feliminate-dwarf2-dups to see what would break. My goal was to reduce the size of the kernel-debuginfo rpm; it's now in the neighborhood of 850 megabytes. I got an error early on and reduced it to the following simple case involving four files, given below. The output of the command "make bad" follows:
-------- output of "make clean bad" starts $ make clean bad rm -f *.o z cc -g -feliminate-dwarf2-dups -c -o a.o a.c ld -r -o b.o a.o cc -g -feliminate-dwarf2-dups -c -o c.o c.c cc -o z b.o c.o c.o: In function `DW.z.h.aabf8719.0': c.c:(.gnu.linkonce.wi.z.h.aabf8719+0x19): multiple definition of `DW.z.h.aabf8719.0' b.o:(.debug_info+0xa3): first defined here collect2: ld returned 1 exit status make: *** [bad] Error 1 $ -------- end output and here's the output of "make clean good": -------- start $ make clean good rm -f *.o z cc -g -feliminate-dwarf2-dups -c -o a.o a.c cc -g -feliminate-dwarf2-dups -c -o c.o c.c cc -o z a.o c.o $ -------- end The same bug shows up in ld version: GNU ld version 2.16.91.0.6 20060212 and a version I made yesterday 9/21/06 from the cvs tree: GNU ld version 2.17.50 20060922. The version of gcc is the current one on Fedora Core 5: gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1). Here are the four source files, from "head -99 a.c c.c z.h Makefile": -------- start of source files ==> a.c <== #include "z.h" struct foo_s foo; int main(int argc, char *argv[]) { doprintf(); } ==> c.c <== #include "z.h" struct foo_s foo; doprintf() { return; } ==> z.h <== struct foo_s { int foo; }; ==> Makefile <== CFLAGS = -g -feliminate-dwarf2-dups all: echo "Choose target 'bad' or 'good'" b.o: a.o $(LD) -r -o $@ $< good: a.o c.o $(CC) -o z a.o c.o bad: b.o c.o $(CC) -o z b.o c.o clean: rm -f *.o z -------- end of source files Richard Hitt -- Summary: Msg "multiple definition of" with "-feliminate- dwarf2_dups" involvement Product: binutils Version: 2.17 Status: NEW Severity: normal Priority: P2 Component: ld AssignedTo: unassigned at sources dot redhat dot com ReportedBy: rbh00 at utsglobal dot com CC: bug-binutils at gnu dot org http://sourceware.org/bugzilla/show_bug.cgi?id=3249 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils