From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5330 invoked by alias); 1 Mar 2011 21:50:32 -0000 Received: (qmail 5221 invoked by uid 22791); 1 Mar 2011 21:50:31 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD,T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Mar 2011 21:50:24 +0000 Received: from wpaz5.hot.corp.google.com (wpaz5.hot.corp.google.com [172.24.198.69]) by smtp-out.google.com with ESMTP id p21LoLnX006374 for ; Tue, 1 Mar 2011 13:50:21 -0800 Received: from iyf40 (iyf40.prod.google.com [10.241.50.104]) by wpaz5.hot.corp.google.com with ESMTP id p21Lnnbx025195 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 1 Mar 2011 13:50:20 -0800 Received: by iyf40 with SMTP id 40so4738775iyf.36 for ; Tue, 01 Mar 2011 13:50:20 -0800 (PST) Received: by 10.43.56.20 with SMTP id wa20mr1290262icb.521.1299016219892; Tue, 01 Mar 2011 13:50:19 -0800 (PST) Received: from coign.google.com (dhcp-172-22-123-197.mtv.corp.google.com [172.22.123.197]) by mx.google.com with ESMTPS id xa8sm4195226icb.10.2011.03.01.13.50.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Mar 2011 13:50:19 -0800 (PST) From: Ian Lance Taylor To: binutils@sourceware.org Subject: gold patch committed: Copy TLS fix to 2.21 branch Date: Tue, 01 Mar 2011 21:50:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-System-Of-Record: true 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-03/txt/msg00005.txt.bz2 --=-=-= Content-length: 295 I have committed this gold patch to the binutils 2.21 branch. Ian 2011-03-01 Ian Lance Taylor Backport from mainline: 2011-01-04 Cary Coutant * script-sections.cc (Sort_output_sections::operator()): Sort TLS sections before NOBITS sections. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=foo.patch Content-Description: patch Content-length: 1564 Index: script-sections.cc =================================================================== RCS file: /cvs/src/src/gold/script-sections.cc,v retrieving revision 1.46 diff -u -p -r1.46 script-sections.cc --- script-sections.cc 3 Nov 2010 14:07:49 -0000 1.46 +++ script-sections.cc 1 Mar 2011 21:49:52 -0000 @@ -1,6 +1,6 @@ // script-sections.cc -- linker script SECTIONS for gold -// Copyright 2008, 2009 Free Software Foundation, Inc. +// Copyright 2008, 2009, 2010, 2011 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -3586,17 +3586,18 @@ Sort_output_sections::operator()(const O if (os1->address() != os2->address()) return os1->address() < os2->address(); - // Sort TLS sections to the end. + // Sort PROGBITS before NOBITS. + bool nobits1 = os1->type() == elfcpp::SHT_NOBITS; + bool nobits2 = os2->type() == elfcpp::SHT_NOBITS; + if (nobits1 != nobits2) + return nobits2; + + // Sort PROGBITS TLS sections to the end, NOBITS TLS sections to the + // beginning. bool tls1 = (os1->flags() & elfcpp::SHF_TLS) != 0; bool tls2 = (os2->flags() & elfcpp::SHF_TLS) != 0; if (tls1 != tls2) - return tls2; - - // Sort PROGBITS before NOBITS. - if (os1->type() == elfcpp::SHT_PROGBITS && os2->type() == elfcpp::SHT_NOBITS) - return true; - if (os1->type() == elfcpp::SHT_NOBITS && os2->type() == elfcpp::SHT_PROGBITS) - return false; + return nobits1 ? tls1 : tls2; // Sort non-NOLOAD before NOLOAD. if (os1->is_noload() && !os2->is_noload()) --=-=-=--