exynos-linux-stable/scripts/gdb/linux
Ilya Leoshkevich bbcf6158ad scripts/gdb: fix debugging modules compiled with hot/cold partitioning
[ 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 <iii@linux.ibm.com>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Kieran Bingham <kbingham@kernel.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-05 15:34:10 +01:00
..
.gitignore scripts/gdb: add constants.py to .gitignore 2016-07-15 14:54:27 +09:00
__init__.py scripts/gdb: add empty package initialization script 2015-02-28 09:57:51 -08:00
constants.py.in Revert "scripts/gdb: add a Radix Tree Parser" 2016-07-15 14:54:27 +09:00
cpus.py scripts/gdb: cast CPU numbers to integer 2016-05-23 17:04:14 -07:00
dmesg.py scripts/gdb: decode bytestream on dmesg for Python3 2016-05-23 17:04:14 -07:00
lists.py scripts/gdb: provide kernel list item generators 2016-05-23 17:04:14 -07:00
Makefile scripts/gdb: rebuild constants.py on dependancy change 2016-07-15 14:54:27 +09:00
modules.py scripts/gdb: support !CONFIG_MODULES gracefully 2016-05-23 17:04:14 -07:00
proc.py scripts/gdb: add mount point list command 2016-05-23 17:04:14 -07:00
symbols.py scripts/gdb: fix debugging modules compiled with hot/cold partitioning 2019-12-05 15:34:10 +01:00
tasks.py scripts/gdb/linux/tasks.py: fix get_thread_info 2018-01-23 19:57:08 +01:00
utils.py scripts/gdb: improve types abstraction for gdb python scripts 2016-05-23 17:04:14 -07:00