View Bug Activity | Format For Printing
If gcc is modified to use comdat group instead of linkonce section. It may generate code like: .section .text,"axG",@progbits,.__i686.get_pc_thunk.bx,comdat .globl __i686.get_pc_thunk.bx .hidden __i686.get_pc_thunk.bx .type __i686.get_pc_thunk.bx, @function __i686.get_pc_thunk.bx: instead of .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits .globl __i686.get_pc_thunk.bx .hidden __i686.get_pc_thunk.bx .type __i686.get_pc_thunk.bx,@function __i686.get_pc_thunk.bx: The new gcc should work with the libraris compiled with the oldler gcc. But the current linker doesn't support mixing comdat group with linkonce section. I think the linker should match a member of a COMDAT group with a single member with a linkonce section.
Created an attachment (id=122) A testcase [hjl@gnu 1]$ make LD=/export/build/gnu/binutils-debug/build-i686-linux/ld/ld-new/export/build/gnu/binutils-debug/build-i686-linux/ld/ld-new -o 1a.o x1.o y1.o y1.o(.text[.__i686.get_pc_thunk.bx]+0x0): In function `__i686.get_pc_thunk.bx': : multiple definition of `__i686.get_pc_thunk.bx' x1.o(.gnu.linkonce.t.__i686.get_pc_thunk.bx+0x0): first defined here /export/build/gnu/binutils-debug/build-i686-linux/ld/ld-new: warning: cannot find entry symbol _start; defaulting to 08048074 make: [1a.o] Error 1 (ignored) /export/build/gnu/binutils-debug/build-i686-linux/ld/ld-new -r -o 1a.o x1.o y1.oy1.o(.text[.__i686.get_pc_thunk.bx]+0x0): In function `__i686.get_pc_thunk.bx': : multiple definition of `__i686.get_pc_thunk.bx' x1.o(.gnu.linkonce.t.__i686.get_pc_thunk.bx+0x0): first defined here make: *** [1a.o] Error 1
*** This bug has been marked as a duplicate of 161 ***