From owner-svn-src-stable-8@FreeBSD.ORG Sat Aug 21 18:38:57 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EC2110656A5; Sat, 21 Aug 2010 18:38:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0E328FC13; Sat, 21 Aug 2010 18:38:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LIcuaq077670; Sat, 21 Aug 2010 18:38:56 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LIcupO077668; Sat, 21 Aug 2010 18:38:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201008211838.o7LIcupO077668@svn.freebsd.org> From: Andriy Gapon Date: Sat, 21 Aug 2010 18:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211583 - stable/8/contrib/binutils/ld/emultempl X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2010 18:38:57 -0000 Author: avg Date: Sat Aug 21 18:38:56 2010 New Revision: 211583 URL: http://svn.freebsd.org/changeset/base/211583 Log: MFC r210245: binutils/ld: fix incorrect placement of __start_SECNAME in some cases Modified: stable/8/contrib/binutils/ld/emultempl/elf32.em Directory Properties: stable/8/contrib/binutils/ (props changed) Modified: stable/8/contrib/binutils/ld/emultempl/elf32.em ============================================================================== --- stable/8/contrib/binutils/ld/emultempl/elf32.em Sat Aug 21 18:26:55 2010 (r211582) +++ stable/8/contrib/binutils/ld/emultempl/elf32.em Sat Aug 21 18:38:56 2010 (r211583) @@ -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