Bug 246 - Can't mix comdat group with linkonce section
Summary: Can't mix comdat group with linkonce section
Status: RESOLVED DUPLICATE of bug 161
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-30 18:13 UTC by H.J. Lu
Modified: 2004-07-02 14:33 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
A testcase (441 bytes, application/octet-stream)
2004-06-30 18:15 UTC, H.J. Lu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2004-06-30 18:14:00 UTC
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.
Comment 1 H.J. Lu 2004-06-30 18:15:40 UTC
Created attachment 122 [details]
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
Comment 2 H.J. Lu 2004-07-02 14:33:56 UTC

*** This bug has been marked as a duplicate of 161 ***