[merged] scripts-gdb-fix-debugging-modules-compiled-with-hot-cold-partitioning.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: scripts/gdb: fix debugging modules compiled with hot/cold partitioning
has been removed from the -mm tree.  Its filename was
     scripts-gdb-fix-debugging-modules-compiled-with-hot-cold-partitioning.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>
Subject: scripts/gdb: fix debugging modules compiled with hot/cold partitioning

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@xxxxxxxxxxxxx
Signed-off-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>
Reviewed-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
Cc: Kieran Bingham <kbingham@xxxxxxxxxx>
Cc: Heiko Carstens <heiko.carstens@xxxxxxxxxx>
Cc: Vasily Gorbik <gor@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 scripts/gdb/linux/symbols.py |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/scripts/gdb/linux/symbols.py~scripts-gdb-fix-debugging-modules-compiled-with-hot-cold-partitioning
+++ a/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(
_

Patches currently in -mm which might be from iii@xxxxxxxxxxxxx are

mm-sparsec-mark-populate_section_memmap-as-__meminit.patch
mm-sparsec-mark-populate_section_memmap-as-__meminit-v2.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux