From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8349 invoked by alias); 24 Aug 2012 17:41:15 -0000 Received: (qmail 8337 invoked by uid 22791); 24 Aug 2012 17:41:14 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-lb0-f169.google.com (HELO mail-lb0-f169.google.com) (209.85.217.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Aug 2012 17:41:01 +0000 Received: by lbon3 with SMTP id n3so1315852lbo.0 for ; Fri, 24 Aug 2012 10:40:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-system-of-record:x-gm-message-state; bh=5St7sqGhTZtiPdo+1juMUeqIgWvrOZDfN3asa0CBT/0=; b=XarSxtQhjBd+nb0CQuT+rIPMTGtQIxBUb0BueGBSHP0wMDE0Mbgtkw3P5ticHHyIMS gO7LWUuBH8UqvHvcorpM9WwzTSEtf5+t/RLO67A/Ht+AiXm+kBnnHRWfybxw+yZUcmvx yaR/SVZpxoSXWqSKTrIobT2m+1cOTPsI9CiFU8KGZAuOBM1VBRFWJYsrtTI1fXHkMy9m n6jLyEmMTHXr/aTVdZl8mQ2RCbl5ohWPqKTrUNHkvb5SLOcpnO9lp+/b+axhc+PR7kin bq2ZSR4DeFHHYUnOWmspNVsDuE515dXnxX6EglIdAYB9mdlVjNM+PZfAPsSXTvmT+RFA pA3w== Received: by 10.152.125.133 with SMTP id mq5mr6604364lab.12.1345830059673; Fri, 24 Aug 2012 10:40:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.152.125.133 with SMTP id mq5mr6604354lab.12.1345830059570; Fri, 24 Aug 2012 10:40:59 -0700 (PDT) Received: by 10.112.131.129 with HTTP; Fri, 24 Aug 2012 10:40:59 -0700 (PDT) In-Reply-To: References: Date: Fri, 24 Aug 2012 17:44:00 -0000 Message-ID: Subject: Re: [patch] Gold linker patch to provide plugin support for mapping some text sections to an unique ELF segment. From: Cary Coutant To: Sriraman Tallam Cc: Ian Lance Taylor , binutils Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-Gm-Message-State: ALoCoQkBsPJdVIkqzhmAKhGRQQHA7bbGe5WpDYHkivgRGoGfm625j3LfshI6dCsO8+e7UuKvuFNN8/EldOD4ihdLdkxI0bRdswix+5qQ5658WPYckfHkUtBGU/egL497cYfVKYTE1OSm8FA9KIvgS24YJw82HbDE+uaZv+aR0nwO+NHOxWkNZmjm0QBAGbygKS6yNRZMhnv0 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: 2012-08/txt/msg00443.txt.bz2 > I have made all the changes and attached the patch. @@ -1734,8 +1788,13 @@ Layout::attach_allocated_section_to_segm p != this->segment_list_.end(); ++p) { + // No need to go through the loop if a unique segment is needed. + if (os->is_unique_segment()) + break; I'd suggest moving this test outside the for loop. If this condition is true, there's no point even entering the loop. (I'd hope the compiler is smart enough to figure that out anyway, but I think it would be clearer to the reader. Aside from that and what Ian noted, it looks good to me. -cary