Skip to content

Commit 279917e

Browse files
committed
parisc: Fix backtrace to always include init funtion names
I noticed that sometimes at kernel startup the backtraces did not included the function names of init functions. Their address were not resolved to function names and instead only the address was printed. Debugging shows that the culprit is is_ksym_addr() which is called by the backtrace functions to check if an address belongs to a function in the kernel. The problem occurs only for CONFIG_KALLSYMS_ALL=y. When looking at is_ksym_addr() one can see that for CONFIG_KALLSYMS_ALL=y the function only tries to resolve the address via is_kernel() function, which checks like this: if (addr >= _stext && addr <= _end) return 1; On parisc the init functions are located before _stext, so this check fails. Other platforms seem to have all functions (including init functions) behind _stext. The following patch moves the _stext symbol at the beginning of the kernel and thus includes the init section. This fixes the check and does not seem to have any negative side effects on where the kernel mapping happens in the map_pages() function in arch/parisc/mm/init.c. Signed-off-by: Helge Deller <[email protected]> Cc: [email protected] # 5.4+
1 parent c8103c2 commit 279917e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/parisc/kernel/vmlinux.lds.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ SECTIONS
5757
{
5858
. = KERNEL_BINARY_TEXT_START;
5959

60+
_stext = .; /* start of kernel text, includes init code & data */
61+
6062
__init_begin = .;
6163
HEAD_TEXT_SECTION
6264
MLONGCALL_DISCARD(INIT_TEXT_SECTION(8))
@@ -80,7 +82,6 @@ SECTIONS
8082
/* freed after init ends here */
8183

8284
_text = .; /* Text and read-only data */
83-
_stext = .;
8485
MLONGCALL_KEEP(INIT_TEXT_SECTION(8))
8586
.text ALIGN(PAGE_SIZE) : {
8687
TEXT_TEXT

0 commit comments

Comments
 (0)