Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp733271ybl; Wed, 4 Dec 2019 09:59:58 -0800 (PST) X-Google-Smtp-Source: APXvYqw/SiWYOkVjHRLdSejF4s2vcCVnRSETUjSbaDkyBftWl/jwXnzf49EFWCmxNUOlOTWRjS6D X-Received: by 2002:aca:d507:: with SMTP id m7mr3541398oig.48.1575482398314; Wed, 04 Dec 2019 09:59:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575482398; cv=none; d=google.com; s=arc-20160816; b=lx/oFZkWYDGSQOzLQrSTTBtMVl4ARV8jehk+5qWx7PtHls98i/dIAcrW3AlUCEMQbl a5IbYTLLWsmzxktIAdX4Q1yppcMEglaUDNm7vOlfkb0yEwh5f5QNyZyP3JIED0ziO1kv j6SzK/qMfe98mVaE6gntz4Y26z+SOkQrF76A4Pk208fVaUoPQowR/xHdlBZBvt+cf1L6 nDpGoF7J6rPHmPWHUukgn2AoXT6zT9Ql/g926Nl4N1yUVF717v++yPXveto9w9ytm7ma 2jnj3MSobYPnGXtxOW5iQJJWs00y0omzHE9j09Ju5m0tSMaeNQ2keLp2b7m6ejA0mGM2 qyXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mFKIhF0tAIHFoRmMz/o9fG0OLJeYxNdClWpelTftMuY=; b=VzxcOT63PNabbLHxKrSez5aOt61690M349DOZP7eLK8RDPUlUsI3qkvR3ClckVchl3 981eidx0EkXelGKYNu+P2fRYO4+GacfgVOzD9e87RGRSiiszUhLiaYE0HCiYNLd4P97d qfdkEDl0nPshiRoofqp06P6n66WVWta0c8SAatO/O66bVcTQqw1QXLeb1wLB/Lfbkv+s bPfUps1u2CrNldnms1yK0K8kntky+7//Fe6XfvEJAR4XkQ71mb0Ndd/qt8q7Sbt7N/wx y5vamvggmSO7Q33QMxNmK6AgnkZYzvm5ULBHoxQhY4uvdKezGIZXpUaIRe6ipQh9R2Nk smpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zgkblvC1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w23si3639353oti.39.2019.12.04.09.59.43; Wed, 04 Dec 2019 09:59:58 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=zgkblvC1; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728930AbfLDR6r (ORCPT + 99 others); Wed, 4 Dec 2019 12:58:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:33906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728229AbfLDR6o (ORCPT ); Wed, 4 Dec 2019 12:58:44 -0500 Received: from localhost (unknown [217.68.49.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9DB2B20865; Wed, 4 Dec 2019 17:58:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482324; bh=QLRIQ6w2SD3IKDPtQP3oJZdEEthwGbIiI78k4VHxfbc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zgkblvC1bcvC2jzrpXfuZbHmSXieiv88LRH5iaaLo6RTZ7PVxrn5zclO77gIKwv5B XOu74uAnFQXGZPx83d7bI3cs8pzvcneykmu7jhgG9w8HhYvdg00ohSeCSxC8gvXPoL l4fG4iiziAoI70zBFJ878sqcEnkGEPMIdihrYwEk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ilya Leoshkevich , Jan Kiszka , Kieran Bingham , Heiko Carstens , Vasily Gorbik , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 4.4 07/92] scripts/gdb: fix debugging modules compiled with hot/cold partitioning Date: Wed, 4 Dec 2019 18:49:07 +0100 Message-Id: <20191204174329.362456823@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204174327.215426506@linuxfoundation.org> References: <20191204174327.215426506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilya Leoshkevich [ Upstream commit 8731acc5068eb3f422a45c760d32198175c756f8 ] gcc's -freorder-blocks-and-partition option makes it group frequently and infrequently used code in .text.hot and .text.unlikely sections respectively. At least when building modules on s390, this option is used by default. gdb assumes that all code is located in .text section, and that .text section is located at module load address. With such modules this is no longer the case: there is code in .text.hot and .text.unlikely, and either of them might precede .text. Fix by explicitly telling gdb the addresses of code sections. It might be tempting to do this for all sections, not only the ones in the white list. Unfortunately, gdb appears to have an issue, when telling it about e.g. loadable .note.gnu.build-id section causes it to think that non-loadable .note.Linux section is loaded at address 0, which in turn causes NULL pointers to be resolved to bogus symbols. So keep using the white list approach for the time being. Link: http://lkml.kernel.org/r/20191028152734.13065-1-iii@linux.ibm.com Signed-off-by: Ilya Leoshkevich Reviewed-by: Jan Kiszka Cc: Kieran Bingham Cc: Heiko Carstens Cc: Vasily Gorbik Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- scripts/gdb/linux/symbols.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index 627750cb420d0..9b71c65504a38 100644 --- a/scripts/gdb/linux/symbols.py +++ b/scripts/gdb/linux/symbols.py @@ -99,7 +99,8 @@ lx-symbols command.""" attrs[n]['name'].string(): attrs[n]['address'] for n in range(int(sect_attrs['nsections']))} args = [] - for section_name in [".data", ".data..read_mostly", ".rodata", ".bss"]: + for section_name in [".data", ".data..read_mostly", ".rodata", ".bss", + ".text", ".text.hot", ".text.unlikely"]: address = section_name_to_address.get(section_name) if address: args.append(" -s {name} {addr}".format( -- 2.20.1