Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1927440ybl; Tue, 3 Dec 2019 15:09:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzmkego2dBC/mhP7zJkeP/MhW/e98l6lXVFW41cF7fsvTsOwKlNftxY5xGKRTPn7yAq2jkv X-Received: by 2002:a05:6830:1715:: with SMTP id 21mr283658otk.67.1575414543787; Tue, 03 Dec 2019 15:09:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575414543; cv=none; d=google.com; s=arc-20160816; b=WN7gXuG5J1Qyt0QW7hBghiVEvC7fnzZ5t/uNPNzn0Qnehp4b+C7ZHNxSSUZ60CSg92 XLNqMj5nn/EGq58NLdmLVZXxVxBnNviXbSU6sO94J5WTZmFM+1y3jK01s64BfDJDKUuk Na8FX/BrCfVi8x7nD+9QpU4HJMWtAsVdq3bJxLYsdLTFDxC6nIedqLBI/CsgCnKvcWOe 0f5PI8AvypIu5Xv6slRIGbg+ESVp+g5m7f6Ly83B3ifIa8uciJleA7aM9bEB0D8WDgQD dB2ctKZru3l2d13LzvC4XYOZdlkx/AhK8FsJK7zVr3k5qV9bn0NEvGC9t6itkI3hlyjp ToeA== 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=Z95Y5VEbDXmiMc21xXaH1f57Gt2xCick/VawdEETzws=; b=TrwPj5PJFidbslPlBRGvwl+nRYUfrp4QM/AQmrOxnIV85TB7okHdh8gBWkBjPM2EmR 9MWT3yJ5/2guwqooyO1kYbzId4QRpjjMsEmg5xcYHhiIsugmoRM2NpXTjqnffhQphgjm cNNlID8RjzexFaJon5wwxmS3ZaBAr7rqOAuiCNf7m3MDpND57cAG/4iokTR/7DC4y0HG gCOEtFBk9HSZUzdk18RSALQLdRFxu/IaBHFmeJvnU9RPOnDWE+r8lqXsEt7LFq5vDaMQ m2Hh/XLlNLw75JNttXBZ3ON3mrk8LxRVBPitj+76yL6FsyHqfeViUQF/vDIwEGPoQ/Pr AqVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hzbf5L6S; 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 j18si1634832otq.275.2019.12.03.15.08.51; Tue, 03 Dec 2019 15:09:03 -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=hzbf5L6S; 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 S1729246AbfLCWqt (ORCPT + 99 others); Tue, 3 Dec 2019 17:46:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:36610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728487AbfLCWqr (ORCPT ); Tue, 3 Dec 2019 17:46:47 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 81B2E2080F; Tue, 3 Dec 2019 22:46:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413206; bh=vAnPksW0U2gh/kfgefM3vVRIFgL1xdGj0P8wJE6kLOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hzbf5L6SQFQvBil3+dd3tQ30Oq8aFquad2PnIOZWkbFWdwt6Rzm8OHhEuRjmadN6z g6BNUe2QbIX/YeyuuGiDuof2sfvc6Y672EiPcIVhsuo8GOC1X3uDy7bLr5pS/MQ6vu l1IoxBN3x7bYvf1D38q5MlqP64gg7Eo3M2+2yL+I= 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.19 038/321] scripts/gdb: fix debugging modules compiled with hot/cold partitioning Date: Tue, 3 Dec 2019 23:31:44 +0100 Message-Id: <20191203223429.093986368@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203223427.103571230@linuxfoundation.org> References: <20191203223427.103571230@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 004b0ac7fa72d..4644f1a83b578 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