public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* RFC: COMDAT group names become anonymouse local symbols
@ 2010-10-19 20:08 Mark Mitchell
  2010-10-20 18:05 ` Cary Coutant
  2010-10-21  0:18 ` Alan Modra
  0 siblings, 2 replies; 39+ messages in thread
From: Mark Mitchell @ 2010-10-19 20:08 UTC (permalink / raw)
  To: binutils


When assembling this trivial file:

	.section	A,"axG",%progbits,B,comdat
        # Note that there is no definition of the symbol B.     		

GAS generates a COMDAT group whose "signature" (in the sense of the
ELF spec) is an anonymous local symbol:

Section Headers:
  [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
  [ 1] B                 GROUP           0000000000000000 000040 000008 04      7   5  4

Symbol table '.symtab' contains 6 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     5: 0000000000000000     0 SECTION LOCAL  DEFAULT    1 

This seems bad.  The documentation for the .section directive says
that B is the group name, and since the linker's collapsing of COMDAT
groups is done based on the *signature*, not the name referred to by
the section header itself, this seems wrong.

On the other hand, perhaps GCC shouldn't generate code like this.  (It
does, at present, for certain C++ inputs.)  The assembler certainly
shouldn't create a global symbol named "B".  If the assembler were to
create a local symbol with the name "B", would the linker still
combine this COMDAT group with another group in another object file
also named "B", even if both had different local symbols as their
signatures?

Thanks,

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2010-10-26 16:12 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-19 20:08 RFC: COMDAT group names become anonymouse local symbols Mark Mitchell
2010-10-20 18:05 ` Cary Coutant
2010-10-20 18:19   ` Mark Mitchell
2010-10-21  6:12     ` Cary Coutant
2010-10-21  0:18 ` Alan Modra
2010-10-21  0:31   ` Mark Mitchell
2010-10-21  1:04     ` Ian Lance Taylor
2010-10-21  4:41       ` Mark Mitchell
2010-10-21  5:19         ` H.J. Lu
2010-10-21  5:27           ` Mark Mitchell
2010-10-21  5:41             ` H.J. Lu
2010-10-21  5:42               ` Mark Mitchell
2010-10-21  6:24         ` Alan Modra
2010-10-21 16:41           ` Mark Mitchell
2010-10-21 18:50             ` Daniel Jacobowitz
2010-10-21 20:22               ` Mark Mitchell
2010-10-21 22:19                 ` Alan Modra
2010-10-21 22:41                   ` Mark Mitchell
2010-10-21 23:11                     ` Alan Modra
2010-10-22  3:23                       ` Mark Mitchell
2010-10-22  4:33                         ` Alan Modra
2010-10-22  6:10                           ` Mark Mitchell
2010-10-22  7:16                             ` Alan Modra
2010-10-22 15:34                               ` Mark Mitchell
2010-10-23  8:16                                 ` Alan Modra
2010-10-23 18:05                                   ` Mark Mitchell
2010-10-24  1:15                                     ` Hans-Peter Nilsson
2010-10-24  1:43                                       ` Mark Mitchell
2010-10-24  3:50                                         ` Hans-Peter Nilsson
2010-10-24  4:34                                           ` Mark Mitchell
2010-10-25 11:45                                             ` Hans-Peter Nilsson
2010-10-25 12:39                                             ` Alan Modra
2010-10-25 15:22                                               ` Mark Mitchell
2010-10-26  3:45                                                 ` Alan Modra
2010-10-26 15:48                                             ` Dave Korn
2010-10-26 15:49                                               ` Mark Mitchell
2010-10-26 15:59                                                 ` Dave Korn
2010-10-26 16:12                                                   ` Dave Korn
2010-10-21  2:12     ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).