Skip to contentSkip to conversation

mksysmap: Fix the mismatch of '.L' symbols in System.map

PATCH In review AliOS system security 3 participants 6 messages May 31, 2020 – Jun 2, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mksysmap: Fix the mismatch of '.L' symbols in System.map

When System.map was generated, the kernel used mksysmap to filter the kernel symbols, but all the symbols with the second letter 'L' in the kernel were filtered out, not just the symbols starting with 'dot + L'.

For example:

ashimida@ubuntu:~/linux$ cat System.map |grep ' .L'
ashimida@ubuntu:~/linux$ nm -n vmlinux |grep ' .L'
ffff0000088028e0 t bLength_show
......
ffff0000092e0408 b PLLP_OUTC_lock
ffff0000092e0410 b PLLP_OUTA_lock

I see that in the original patch[1], the original intent should be to filter all local symbols starting with '.L', so I wonder if the code here may add a '\' before '.L'?

[1]. mksysmap: Add h8300 local symbol pattern

---
 scripts/mksysmap | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/mksysmap +1 -1
index a35acc0..9aa23d1 100755
@@ -41,4 +41,4 @@
 # so we just ignore them to let readprofile continue to work.
 # (At least sparc64 has __crc_ in the middle).
 
-$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)\|\( .L\)' > $2
+$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)\|\( \.L\)' > $2
Signature · 1 line
2.7.4
#1 lore raw
Quoted 13 lines · AliOS system security

When System.map was generated, the kernel used mksysmap to filter the kernel symbols, but all the symbols with the second letter 'L' in the kernel were filtered out, not just the symbols starting with 'dot + L'.

For example:

ashimida@ubuntu:~/linux$ cat System.map |grep ' .L'
ashimida@ubuntu:~/linux$ nm -n vmlinux |grep ' .L'
ffff0000088028e0 t bLength_show
......
ffff0000092e0408 b PLLP_OUTC_lock
ffff0000092e0410 b PLLP_OUTA_lock
Quoted 3 lines

I see that in the original patch[1], the original intent should be to filter all local symbols starting with '.L', so I wonder if the code here may add a '\' before '.L'?

You are right, but please avoid the interrogatory sentence.

Shall I reword as follows?

The original intent should be to filter out all local symbols starting with '.L', so the dot should be escaped.

Quoted 21 lines

[1]. mksysmap: Add h8300 local symbol pattern

---
 scripts/mksysmap | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/mksysmap +1 -2
index a35acc0..9aa23d1 100755
@@ -41,4 +41,4 @@
 # so we just ignore them to let readprofile continue to work.
 # (At least sparc64 has __crc_ in the middle).
 
-$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)\|\( .L\)' > $2
+$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)\|\( \.L\)' > $2
--

2.7.4

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw

Thanks for your suggestion, I will use my personal account to post a new version later, and amend this comment.

Quoted 55 lines · Masahiro Yamada
Quoted 13 lines · AliOS system security

When System.map was generated, the kernel used mksysmap to filter the kernel symbols, but all the symbols with the second letter 'L' in the kernel were filtered out, not just the symbols starting with 'dot + L'.

For example:

ashimida@ubuntu:~/linux$ cat System.map |grep ' .L'
ashimida@ubuntu:~/linux$ nm -n vmlinux |grep ' .L'
ffff0000088028e0 t bLength_show
......
ffff0000092e0408 b PLLP_OUTC_lock
ffff0000092e0410 b PLLP_OUTA_lock
Quoted 3 lines

I see that in the original patch[1], the original intent should be to filter all local symbols starting with '.L', so I wonder if the code here may add a '\' before '.L'?

You are right, but please avoid the interrogatory sentence.

Shall I reword as follows?

The original intent should be to filter out all local symbols starting with '.L', so the dot should be escaped.

Quoted 21 lines

[1]. mksysmap: Add h8300 local symbol pattern

---
  scripts/mksysmap | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
scripts/mksysmap +1 -2
index a35acc0..9aa23d1 100755
@@ -41,4 +41,4 @@
  # so we just ignore them to let readprofile continue to work.
  # (At least sparc64 has __crc_ in the middle).
 
-$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)\|\( .L\)' > $2
+$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)\|\( \.L\)' > $2
--

2.7.4

#3 lore raw
In reply to AliOS system security
Quoted 13 lines · AliOS system security

When System.map was generated, the kernel used mksysmap to filter the kernel symbols, but all the symbols with the second letter 'L' in the kernel were filtered out, not just the symbols starting with 'dot + L'.

For example:

ashimida@ubuntu:~/linux$ cat System.map |grep ' .L'
ashimida@ubuntu:~/linux$ nm -n vmlinux |grep ' .L'
ffff0000088028e0 t bLength_show
......
ffff0000092e0408 b PLLP_OUTC_lock
ffff0000092e0410 b PLLP_OUTA_lock
Quoted 7 lines

I see that in the original patch[1], the original intent should be to filter all local symbols starting with '.L', so I wonder if the code here may add a '\' before '.L'?

[1]. mksysmap: Add h8300 local symbol pattern

I think you should submit this patch
with your real name instead of
the team name.

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw

PATCH v2 1/1 mksysmap: Fix the mismatch of '.L' symbols in System.map

In reply to AliOS system security

When System.map was generated, the kernel used mksysmap to filter the kernel symbols, but all the symbols with the second letter 'L' in the kernel were filtered out, not just the symbols starting with 'dot + L'.

For example:

ashimida@ubuntu:~/linux$ cat System.map |grep ' .L'
ashimida@ubuntu:~/linux$ nm -n vmlinux |grep ' .L'
ffff0000088028e0 t bLength_show
......
ffff0000092e0408 b PLLP_OUTC_lock
ffff0000092e0410 b PLLP_OUTA_lock

In the original patch[1], the original intent should be to filter out all local symbols starting with '.L', so the dot should be escaped.

[1]. mksysmap: Add h8300 local symbol pattern

---
 scripts/mksysmap | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/mksysmap +1 -1
index a35acc0..9aa23d1 100755
@@ -41,4 +41,4 @@
 # so we just ignore them to let readprofile continue to work.
 # (At least sparc64 has __crc_ in the middle).
 
-$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)\|\( .L\)' > $2
+$NM -n $1 | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)\|\( \.L\)' > $2
Signature · 1 line
2.7.4
#5 lore raw
Quoted 14 lines · ashimida

When System.map was generated, the kernel used mksysmap to filter the kernel symbols, but all the symbols with the second letter 'L' in the kernel were filtered out, not just the symbols starting with 'dot + L'.

For example:

ashimida@ubuntu:~/linux$ cat System.map |grep ' .L'
ashimida@ubuntu:~/linux$ nm -n vmlinux |grep ' .L'
ffff0000088028e0 t bLength_show
......
ffff0000092e0408 b PLLP_OUTC_lock
ffff0000092e0410 b PLLP_OUTA_lock
Quoted 8 lines

In the original patch[1], the original intent should be to filter out all local symbols starting with '.L', so the dot should be escaped.

[1]. mksysmap: Add h8300 local symbol pattern

---

Applied to linux-kbuild. Thanks.

Signature · 2 lines
Best Regards
Masahiro Yamada