Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2664556imc; Tue, 12 Mar 2019 20:42:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9mu3QYZD5n97K0aGs8g61+r1ZTTaGAB6QnbOHFwHlk7zWNlpzdTJ6PExJ9spNbW6E1BDd X-Received: by 2002:a17:902:bd02:: with SMTP id p2mr42953101pls.260.1552448570069; Tue, 12 Mar 2019 20:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552448570; cv=none; d=google.com; s=arc-20160816; b=L1Ueo8A4Jl1iJexY9x3c+p+tCQng6bD7dmCDgbHStc9YNZ0vdhdU64h8cUkODr/XS9 Szd9bvr+fNv0IuwxAfZM40xkpAYggnmVacHsiFsquvfPTG863tmF2WYDgqJ2ZOHkPZxS QhfGSqo5UNlM/tW52EweD1fTXSmz6IV6IDy2pWym9RVco5Lf+N+o3SjfRK2ue26Cfxbl zCmhiPkBtR89DA4qek3N0Q/x6KMNPe/PempSp8UqnqljIEjtgKTFmn3cUX+UsnxgQL5Y oHHBtk917FjhzR8FF1urk85IRCHlfWGeBFRqp6LnIFO6favuiBXl+DonCz96/UgFOfAv 1aBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:content-transfer-encoding :mime-version:date:subject:cc:from; bh=pd+8gyspw6hkqx9A5+/vvrb19CmH/05MCBX0kWY0b0E=; b=J4jVAwNeV+kwfASvV5WZnR/AdZhH0Tm3D5znU4TYytqW/IFBQ9xPk3qq7gJTE5ZT5L 1cZvft3A/HIfGY1VyHOXFCBHDPbd1yP08Wuexvy1H4eifwbJ2Xt4Dsn2iNSFklhJfj0r 36nFyrn0wy3kMhVXcUqoAX1b/ThS6v7TEagSlphB04bbznA2XSQhcYf5qRcOwU9kAs2u kEvNR6LzgBwTM6NRB+xZs7IzjtFw8ltnoNZ92CTsuYe3pLS2bPx7BkJrvDFUxies+KJI v3GcExAwI/A1XBa766PXYeOo+YIGnJfH6j5sppNsJ2sRcMrAy1NYz/F2u57ZfM/tQLPY PvcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v69si9613753pfa.37.2019.03.12.20.42.32; Tue, 12 Mar 2019 20:42:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726649AbfCMDlv (ORCPT + 99 others); Tue, 12 Mar 2019 23:41:51 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60538 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725989AbfCMDlv (ORCPT ); Tue, 12 Mar 2019 23:41:51 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2D3dM2J106441 for ; Tue, 12 Mar 2019 23:41:49 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2r6nmu2sb1-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 12 Mar 2019 23:41:49 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Mar 2019 03:41:48 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 13 Mar 2019 03:41:45 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x2D3fi6W33423418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Mar 2019 03:41:44 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 04D044C040; Wed, 13 Mar 2019 03:41:44 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A6F404C04E; Wed, 13 Mar 2019 03:41:43 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 13 Mar 2019 03:41:43 +0000 (GMT) Received: from adsilva.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 50EF2A00D1; Wed, 13 Mar 2019 14:41:40 +1100 (AEDT) From: "Alastair D'Silva" Cc: "Alastair D'Silva" , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] arch/powerpc: Don't assume start_text & head_end align Date: Wed, 13 Mar 2019 14:38:51 +1100 X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19031303-0012-0000-0000-00000301E979 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19031303-0013-0000-0000-000021390D73 Message-Id: <20190313033852.13028-1-alastair@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-13_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=826 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903130024 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alastair D'Silva When building LTO kernels, the start_text symbol is not guaranteed to mark the end of the head section. Instead, look explicitly for __head_end. Signed-off-by: Alastair D'Silva --- arch/powerpc/tools/head_check.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/tools/head_check.sh b/arch/powerpc/tools/head_check.sh index ad9e57209aa4..1b0f634038c3 100644 --- a/arch/powerpc/tools/head_check.sh +++ b/arch/powerpc/tools/head_check.sh @@ -44,7 +44,7 @@ nm="$1" vmlinux="$2" # gcc-4.6-era toolchain make _stext an A (absolute) symbol rather than T -$nm "$vmlinux" | grep -e " [TA] _stext$" -e " t start_first_256B$" -e " a text_start$" -e " t start_text$" -m4 > .tmp_symbols.txt +$nm "$vmlinux" | grep -e " [TA] _stext$" -e " t start_first_256B$" -e " a text_start$" -e " T __head_end$" -m4 > .tmp_symbols.txt vma=$(cat .tmp_symbols.txt | grep -e " [TA] _stext$" | cut -d' ' -f1) @@ -63,12 +63,12 @@ fi top_vma=$(echo $vma | cut -d'0' -f1) -expected_start_text_addr=$(cat .tmp_symbols.txt | grep " a text_start$" | cut -d' ' -f1 | sed "s/^0/$top_vma/") +expected_head_end_addr=$(cat .tmp_symbols.txt | grep " a text_start$" | cut -d' ' -f1 | sed "s/^0/$top_vma/") -start_text_addr=$(cat .tmp_symbols.txt | grep " t start_text$" | cut -d' ' -f1) +head_end_addr=$(cat .tmp_symbols.txt | grep " T __head_end$" | cut -d' ' -f1) -if [ "$start_text_addr" != "$expected_start_text_addr" ]; then - echo "ERROR: start_text address is $start_text_addr, should be $expected_start_text_addr" +if [ "$head_end_addr" != "$expected_head_end_addr" ]; then + echo "ERROR: __head_end address is $head_end_addr, should be $expected_head_end_addr" echo "ERROR: try to enable LD_HEAD_STUB_CATCH config option" echo "ERROR: see comments in arch/powerpc/tools/head_check.sh" -- 2.20.1