From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10069 invoked by alias); 20 Apr 2011 07:01:50 -0000 Received: (qmail 10059 invoked by uid 22791); 20 Apr 2011 07:01:48 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-iw0-f169.google.com (HELO mail-iw0-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Apr 2011 07:01:34 +0000 Received: by iwg8 with SMTP id 8so526915iwg.0 for ; Wed, 20 Apr 2011 00:01:33 -0700 (PDT) Received: by 10.42.225.70 with SMTP id ir6mr994323icb.494.1303282893845; Wed, 20 Apr 2011 00:01:33 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id xg14sm243704icb.19.2011.04.20.00.01.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Apr 2011 00:01:33 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 10D5B170C2AE; Wed, 20 Apr 2011 16:31:28 +0930 (CST) Date: Wed, 20 Apr 2011 07:01:00 -0000 From: Alan Modra To: binutils@sourceware.org Subject: Remove redundant code Message-ID: <20110420070127.GI19947@bubble.grove.modra.org> Mail-Followup-To: binutils@sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-04/txt/msg00283.txt.bz2 More than one bfd_release in a row on the same bfd is never necessary, and in the archive.c case is potentially wrong. * archive.c (_bfd_get_elt_at_filepos): Don't release n_nfd. * elflink.c (elf_link_add_object_symbols): Delete redundant code. Index: bfd/archive.c =================================================================== RCS file: /cvs/src/src/bfd/archive.c,v retrieving revision 1.74 diff -u -p -r1.74 archive.c --- bfd/archive.c 4 Mar 2011 01:43:24 -0000 1.74 +++ bfd/archive.c 20 Apr 2011 00:49:55 -0000 @@ -661,10 +661,6 @@ _bfd_get_elt_at_filepos (bfd *archive, f if (_bfd_add_bfd_to_archive_cache (archive, filepos, n_nfd)) return n_nfd; - /* Huh? */ - /* FIXME: n_nfd isn't allocated in the archive's memory pool. - If we reach this point, I think bfd_release will abort. */ - bfd_release (archive, n_nfd); bfd_release (archive, new_areldata); return NULL; } Index: bfd/elflink.c =================================================================== RCS file: /cvs/src/src/bfd/elflink.c,v retrieving revision 1.399 diff -u -p -r1.399 elflink.c --- bfd/elflink.c 20 Apr 2011 00:22:08 -0000 1.399 +++ bfd/elflink.c 20 Apr 2011 00:50:22 -0000 @@ -4237,10 +4237,7 @@ error_free_dyn: We need to get the alignment from the section. */ align = new_sec->alignment_power; } - if (align > old_alignment - /* Permit an alignment power of zero if an alignment of one - is specified and no other alignments have been specified. */ - || (isym->st_value == 1 && old_alignment == 0)) + if (align > old_alignment) h->root.u.c.p->alignment_power = align; else h->root.u.c.p->alignment_power = old_alignment; -- Alan Modra Australia Development Lab, IBM