android_kernel_xiaomi_sm7250/scripts
Ilya Leoshkevich ff3f7465ee 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 09:19:44 +01:00
..
basic
coccinelle
dtc
gcc-plugins randstruct: Check member structs in is_pure_ops_struct() 2019-10-05 13:10:02 +02:00
gdb scripts/gdb: fix debugging modules compiled with hot/cold partitioning 2019-12-05 09:19:44 +01:00
genksyms genksyms: Teach parser about 128-bit built-in types 2019-07-31 07:27:02 +02:00
kconfig kconfig: Clear "written" flag to avoid data loss 2019-08-06 19:06:53 +02:00
ksymoops
mod
package
selinux
tracing
.gitignore
adjust_autoksyms.sh
asn1_compiler.c
bin2c.c
bloat-o-meter
bootgraph.pl
bpf_helpers_doc.py
cc-can-link.sh
check_00index.sh
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl
checkstack.pl scripts/checkstack.pl: Fix arm64 wrong or unknown architecture 2019-06-25 11:35:58 +08:00
checksyscalls.sh
checkversion.pl
clang-version.sh
cleanfile
cleanpatch
coccicheck
config
conmakehash.c
const_structs.checkpatch
decode_stacktrace.sh scripts/decode_stacktrace: match basepath using shell prefix operator, not regex 2019-09-16 08:21:44 +02:00
decodecode
depmod.sh
diffconfig
documentation-file-ref-check
export_report.pl
extract_xc3028.pl
extract-cert.c
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
faddr2line
file-size.sh
find-unused-docs.sh
gcc-goto.sh
gcc-ld
gcc-plugin.sh
gcc-version.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
get_dvb_firmware
get_maintainer.pl
gfp-translate
headerdep.pl
headers_check.pl
headers_install.sh
headers.sh
insert-sys-cert.c
kallsyms.c kallsyms: exclude kasan local symbols on s390 2019-07-31 07:27:05 +02:00
Kbuild.include
Kconfig.include kbuild: Check for unknown options with cc-option usage in Kconfig and clang 2019-08-25 10:47:56 +02:00
kernel-doc
ld-version.sh
leaking_addresses.pl
Lindent
link-vmlinux.sh
Makefile
Makefile.asm-generic
Makefile.build
Makefile.clean
Makefile.dtbinst
Makefile.extrawarn
Makefile.gcc-plugins
Makefile.headersinst
Makefile.host
Makefile.kasan
Makefile.kcov
Makefile.lib
Makefile.modbuiltin
Makefile.modinst
Makefile.modpost kbuild: modpost: handle KBUILD_EXTRA_SYMBOLS only for external modules 2019-08-25 10:47:55 +02:00
Makefile.modsign
Makefile.ubsan
makelst
markup_oops.pl
mkcompile_h
mkmakefile
mksysmap
mkuboot.sh
module-common.lds
namespace.pl namespace: fix namespace.pl script to support relative paths 2019-10-29 09:19:36 +01:00
objdiff
parse-maintainers.pl
patch-kernel
pnmtologo.c
profile2linkerlist.pl
prune-kernel
recordmcount.c
recordmcount.h recordmcount: Fix spurious mcount entries on powerpc 2019-07-31 07:27:03 +02:00
recordmcount.pl
setlocalversion scripts/setlocalversion: Improve -dirty check with git-status --no-optional-locks 2019-11-06 13:05:27 +01:00
show_delta
sign-file.c
sortextable.c
sortextable.h
spdxcheck.py
spelling.txt
sphinx-pre-install scripts/sphinx-pre-install: fix script for RHEL/CentOS 2019-08-16 10:12:44 +02:00
split-man.pl
stackdelta
stackusage
subarch.include
tags.sh
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh