This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: Fix COMMON_ROW\defw (Re: Strang code in elf_merge_symbol)


On Mon, Sep 10, 2001 at 01:29:25PM -0700, H . J . Lu wrote:
> In elf_merge_symbol, there is
> 
>   if (! newdyn
>       && (newdef 
>           || (bfd_is_com_section (sec)
>               && (h->root.type == bfd_link_hash_defweak
>                   || h->type == STT_FUNC)))
>       && olddyn
>       && olddef
>       && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
>       && (bind != STB_WEAK
>           || h->root.type == bfd_link_hash_defweak))
>     {
> 
> I don't understand
> 
>              (bfd_is_com_section (sec)
>               && (h->root.type == bfd_link_hash_defweak
>                   || h->type == STT_FUNC))
> 
> If the symbol is in the common section, can it be STT_FUNC?
> 

Never mind. I found the comment for it. But according to the gABI,
common should override weak. Here is a patch.


H.J.
---
2001-09-10  H.J. Lu  <hjl@gnu.org>

	* inker.c (link_action): Change COMMON_ROW\defw from CREF to
	COM.

Index: linker.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/linker.c,v
retrieving revision 1.11
diff -u -p -r1.11 linker.c
--- linker.c	2001/08/24 20:02:23	1.11
+++ linker.c	2001/09/10 21:00:45
@@ -1411,7 +1411,7 @@ static const enum link_action link_actio
   /* UNDEFW_ROW	*/  {WEAK,  NOACT, NOACT, REF,   REF,   NOACT, REFC,  WARNC },
   /* DEF_ROW 	*/  {DEF,   DEF,   DEF,   MDEF,  DEF,   CDEF,  MDEF,  CYCLE },
   /* DEFW_ROW 	*/  {DEFW,  DEFW,  DEFW,  NOACT, NOACT, NOACT, NOACT, CYCLE },
-  /* COMMON_ROW	*/  {COM,   COM,   COM,   CREF,  CREF,  BIG,   REFC,  WARNC },
+  /* COMMON_ROW	*/  {COM,   COM,   COM,   CREF,  COM,  BIG,   REFC,  WARNC },
   /* INDR_ROW	*/  {IND,   IND,   IND,   MDEF,  IND,   CIND,  MIND,  CYCLE },
   /* WARN_ROW   */  {MWARN, WARN,  WARN,  CWARN, CWARN, WARN,  CWARN, MWARN },
   /* SET_ROW	*/  {SET,   SET,   SET,   SET,   SET,   SET,   CYCLE, CYCLE }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]