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]
Other format: [Raw text]

Re: PATCH: Remove bfd_comdat_info and move section_already_linked


On Wed, Jul 21, 2004 at 09:28:18AM +0100, Nick Clifton wrote:
> Hi H. J.
> 
> >The problem is _bfd_elf_section_already_linked will be changed into
> >somthing which helper functions won't work to support
> 
> Ok then - your revised patch (binutils-comdat-6.patch) is approved - 
> please check it in.
> 

I checked it in with 2 small changes, one is a bug fix and the other
is optimization.

I will post a comdat group patch later.

Thanks.


H.J.
 --- binutils/bfd/elflink.c.comdat	2004-07-19 09:49:44.000000000 -0700
-+++ binutils/bfd/elflink.c	2004-07-20 11:21:14.000000000 -0700
++++ binutils/bfd/elflink.c	2004-07-21 08:30:01.105130966 -0700
 @@ -9034,3 +9034,89 @@ bfd_elf_discard_info (bfd *output_bfd, s
  
    return ret;
@@ -402,7 +402,7 @@ ld/
 +	 a linkonce section with a linkonce section, and ignore comdat
 +	 section.  */
 +      if ((sec->flags & SEC_GROUP) == (l->sec->flags & SEC_GROUP)
-+	  && bfd_coff_get_comdat_section (abfd, l->sec) == NULL)
++	  && bfd_coff_get_comdat_section (l->sec->owner, l->sec) == NULL)
 +	{
 +	  /* The section has already been linked.  See if we should
 +             issue a warning.  */
 --- binutils/binutils/objdump.c.comdat	2004-06-21 14:05:20.000000000 -0700
-+++ binutils/binutils/objdump.c	2004-07-20 11:21:14.000000000 -0700
-@@ -351,9 +351,10 @@ dump_section_header (bfd *abfd ATTRIBUTE
++++ binutils/binutils/objdump.c	2004-07-21 08:33:40.409734143 -0700
+@@ -331,6 +331,7 @@ dump_section_header (bfd *abfd ATTRIBUTE
+   if ((section->flags & SEC_LINK_ONCE) != 0)
+     {
+       const char *ls;
++      struct coff_comdat_info *comdat;
+ 
+       switch (section->flags & SEC_LINK_DUPLICATES)
+ 	{
+@@ -351,9 +352,9 @@ dump_section_header (bfd *abfd ATTRIBUTE
  	}
        printf ("%s%s", comma, ls);
  
 -      if (section->comdat != NULL)
 -	printf (" (COMDAT %s %ld)", section->comdat->name,
 -		section->comdat->symbol);
-+      if (bfd_coff_get_comdat_section (abfd, section) != NULL)
-+	printf (" (COMDAT %s %ld)",
-+		bfd_coff_get_comdat_section (abfd, section)->name,
-+		bfd_coff_get_comdat_section (abfd, section)->symbol);
++      comdat = bfd_coff_get_comdat_section (abfd, section);
++      if (comdat != NULL)
++	printf (" (COMDAT %s %ld)", comdat->name, comdat->symbol);
  
        comma = ", ";
      }
 --- binutils/ld/ldlang.c.comdat	2004-07-19 09:57:29.000000000 -0700
-+++ binutils/ld/ldlang.c	2004-07-20 11:21:14.000000000 -0700
++++ binutils/ld/ldlang.c	2004-07-20 14:02:13.000000000 -0700
 @@ -884,44 +884,10 @@ exp_init_os (etree_type *exp)
      }
  }


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