mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-03 10:10:33 +02:00 
			
		
		
		
	scripts/mksysmap: use sed with in-line comments
It is not feasible to insert comments in a multi-line shell command. Use sed, and move comments close to the code. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
		
							parent
							
								
									e9f76363d0
								
							
						
					
					
						commit
						c4802044a0
					
				
					 1 changed files with 37 additions and 24 deletions
				
			
		| 
						 | 
				
			
			@ -11,32 +11,45 @@
 | 
			
		|||
# Generate System.map (actual filename passed as second argument)
 | 
			
		||||
# The following refers to the symbol type as per nm(1).
 | 
			
		||||
 | 
			
		||||
# For System.map filter away:
 | 
			
		||||
#   a - local absolute symbols
 | 
			
		||||
#   U - undefined global symbols
 | 
			
		||||
#   N - debugging symbols
 | 
			
		||||
#   w - local weak symbols
 | 
			
		||||
 | 
			
		||||
# readprofile starts reading symbols when _stext is found, and
 | 
			
		||||
# continue until it finds a symbol which is not either of 'T', 't',
 | 
			
		||||
# 'W' or 'w'.
 | 
			
		||||
#
 | 
			
		||||
# Ignored prefixes:
 | 
			
		||||
#  $                    - local symbols for ARM, MIPS, etc.
 | 
			
		||||
#  .L                   - local labels, .LBB,.Ltmpxxx,.L__unnamed_xx,.LASANPC, etc.
 | 
			
		||||
#  __crc_               - modversions
 | 
			
		||||
#  __kstrtab_           - EXPORT_SYMBOL (symbol name)
 | 
			
		||||
#  __kstrtabns_         - EXPORT_SYMBOL (namespace)
 | 
			
		||||
#
 | 
			
		||||
# Ignored symbols:
 | 
			
		||||
#  L0                   - for LoongArch?
 | 
			
		||||
 | 
			
		||||
$NM -n $1 | grep -v		\
 | 
			
		||||
	-e ' [aNUw] '		\
 | 
			
		||||
	-e ' \$'		\
 | 
			
		||||
	-e ' \.L'		\
 | 
			
		||||
	-e ' __crc_'		\
 | 
			
		||||
	-e ' __kstrtab_'	\
 | 
			
		||||
	-e ' __kstrtabns_'	\
 | 
			
		||||
	-e ' L0$'		\
 | 
			
		||||
> $2
 | 
			
		||||
${NM} -n ${1} | sed >${2} -e "
 | 
			
		||||
# ---------------------------------------------------------------------------
 | 
			
		||||
# Ignored symbol types
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# a: local absolute symbols
 | 
			
		||||
# N: debugging symbols
 | 
			
		||||
# U: undefined global symbols
 | 
			
		||||
# w: local weak symbols
 | 
			
		||||
/ [aNUw] /d
 | 
			
		||||
 | 
			
		||||
# ---------------------------------------------------------------------------
 | 
			
		||||
# Ignored prefixes
 | 
			
		||||
#  (do not forget a space before each pattern)
 | 
			
		||||
 | 
			
		||||
# local symbols for ARM, MIPS, etc.
 | 
			
		||||
/ \$/d
 | 
			
		||||
 | 
			
		||||
# local labels, .LBB, .Ltmpxxx, .L__unnamed_xx, .LASANPC, etc.
 | 
			
		||||
/ \.L/d
 | 
			
		||||
 | 
			
		||||
# CRC from modversions
 | 
			
		||||
/ __crc_/d
 | 
			
		||||
 | 
			
		||||
# EXPORT_SYMBOL (symbol name)
 | 
			
		||||
/ __kstrtab_/d
 | 
			
		||||
 | 
			
		||||
# EXPORT_SYMBOL (namespace)
 | 
			
		||||
/ __kstrtabns_/d
 | 
			
		||||
 | 
			
		||||
# ---------------------------------------------------------------------------
 | 
			
		||||
# Ignored symbols (exact match)
 | 
			
		||||
#  (do not forget a space before and '$' after each pattern)
 | 
			
		||||
 | 
			
		||||
# for LoongArch?
 | 
			
		||||
/ L0$/d
 | 
			
		||||
"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue