Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51962a9d authored by Guenter Roeck's avatar Guenter Roeck Committed by Linus Torvalds
Browse files

scripts/kallsyms.c: ignore symbol type 'n'

gcc on aarch64 may emit synbols of type 'n' if the kernel is built with
'-frecord-gcc-switches'.  In most cases, those symbols are reported with
nm as

	000000000000000e n $d

and with objdump as

	0000000000000000 l    d  .GCC.command.line	0000000000000000 .GCC.command.line
	000000000000000e l       .GCC.command.line	0000000000000000 $d

Those symbols are detected in is_arm_mapping_symbol() and ignored.
However, if "--prefix-symbols=<prefix>" is configured as well, the
situation is different.  For example, in efi/libstub, arm64 images are
built with

	'--prefix-alloc-sections=.init --prefix-symbols=__efistub_'.

In combination with '-frecord-gcc-switches', the symbols are now reported
by nm as:

	000000000000000e n __efistub_$d
and by objdump as:
	0000000000000000 l    d  .GCC.command.line	0000000000000000 .GCC.command.line
	000000000000000e l       .GCC.command.line	0000000000000000 __efistub_$d

Those symbols are no longer ignored and included in the base addr...
parent 7ddd8faf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ static int read_symbol(FILE *in, struct sym_entry *s)
	else if (str[0] == '$')
		return -1;
	/* exclude debugging symbols */
	else if (stype == 'N')
	else if (stype == 'N' || stype == 'n')
		return -1;

	/* include the type field in the symbol name, so that it gets