Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Aug 2010 18:40:43 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r211584 - stable/7/contrib/binutils/ld/emultempl
Message-ID:  <201008211840.o7LIehIB077756@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Sat Aug 21 18:40:42 2010
New Revision: 211584
URL: http://svn.freebsd.org/changeset/base/211584

Log:
  MFC r210245: binutils/ld: fix incorrect placement of __start_SECNAME in
  some cases

Modified:
  stable/7/contrib/binutils/ld/emultempl/elf32.em
Directory Properties:
  stable/7/contrib/binutils/   (props changed)

Modified: stable/7/contrib/binutils/ld/emultempl/elf32.em
==============================================================================
--- stable/7/contrib/binutils/ld/emultempl/elf32.em	Sat Aug 21 18:38:56 2010	(r211583)
+++ stable/7/contrib/binutils/ld/emultempl/elf32.em	Sat Aug 21 18:40:42 2010	(r211584)
@@ -1314,26 +1314,6 @@ gld${EMULATION_NAME}_place_orphan (lang_
       lang_list_init (stat_ptr);
     }
 
-  if (config.build_constructors)
-    {
-      /* If the name of the section is representable in C, then create
-	 symbols to mark the start and the end of the section.  */
-      for (ps = secname; *ps != '\0'; ps++)
-	if (! ISALNUM (*ps) && *ps != '_')
-	  break;
-      if (*ps == '\0')
-	{
-	  char *symname;
-	  etree_type *e_align;
-
-	  symname = (char *) xmalloc (ps - secname + sizeof "__start_");
-	  sprintf (symname, "__start_%s", secname);
-	  e_align = exp_unop (ALIGN_K,
-			      exp_intop ((bfd_vma) 1 << s->alignment_power));
-	  lang_add_assignment (exp_assop ('=', symname, e_align));
-	}
-    }
-
   address = NULL;
   if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
     address = exp_intop ((bfd_vma) 0);
@@ -1354,6 +1334,26 @@ gld${EMULATION_NAME}_place_orphan (lang_
 					    (etree_type *) NULL,
 					    load_base);
 
+  if (config.build_constructors)
+    {
+      /* If the name of the section is representable in C, then create
+	 symbols to mark the start and the end of the section.  */
+      for (ps = secname; *ps != '\0'; ps++)
+	if (! ISALNUM (*ps) && *ps != '_')
+	  break;
+      if (*ps == '\0')
+	{
+	  char *symname;
+	  etree_type *e_align;
+
+	  symname = (char *) xmalloc (ps - secname + sizeof "__start_");
+	  sprintf (symname, "__start_%s", secname);
+	  lang_add_assignment (exp_assop ('=', symname,
+					  exp_unop (ABSOLUTE,
+						    exp_nameop (NAME, "."))));
+	}
+    }
+
   lang_add_section (&os->children, s, os, file);
 
   lang_leave_output_section_statement



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008211840.o7LIehIB077756>