mksysmap 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/sed -f
  2. # SPDX-License-Identifier: GPL-2.0-only
  3. #
  4. # sed script to filter out symbols that are not needed for System.map,
  5. # or not suitable for kallsyms. The input should be 'nm -n <file>'.
  6. #
  7. # System.map is used by module-init tools and some debugging
  8. # tools to retrieve the actual addresses of symbols in the kernel.
  9. #
  10. # readprofile starts reading symbols when _stext is found, and
  11. # continue until it finds a symbol which is not either of 'T', 't',
  12. # 'W' or 'w'.
  13. #
  14. # ---------------------------------------------------------------------------
  15. # Ignored symbol types
  16. #
  17. # a: local absolute symbols
  18. # N: debugging symbols
  19. # U: undefined global symbols
  20. # w: local weak symbols
  21. / [aNUw] /d
  22. # ---------------------------------------------------------------------------
  23. # Ignored prefixes
  24. # (do not forget a space before each pattern)
  25. # local symbols for ARM, MIPS, etc.
  26. / \$/d
  27. # local labels, .LBB, .Ltmpxxx, .L__unnamed_xx, .LASANPC, etc.
  28. / \.L/d
  29. # arm64 EFI stub namespace
  30. / __efistub_/d
  31. # arm64 local symbols in PIE namespace
  32. / __pi_\\$/d
  33. / __pi_\.L/d
  34. # arm64 local symbols in non-VHE KVM namespace
  35. / __kvm_nvhe_\$/d
  36. / __kvm_nvhe_\.L/d
  37. # lld arm/aarch64/mips thunks
  38. / __[[:alnum:]]*Thunk_/d
  39. # CFI type identifiers
  40. / __kcfi_typeid_/d
  41. / __kvm_nvhe___kcfi_typeid_/d
  42. / __pi___kcfi_typeid_/d
  43. # CRC from modversions
  44. / __crc_/d
  45. # EXPORT_SYMBOL (symbol name)
  46. / __kstrtab_/d
  47. # EXPORT_SYMBOL (namespace)
  48. / __kstrtabns_/d
  49. # MODULE_DEVICE_TABLE (symbol name)
  50. / __mod_device_table__/d
  51. # ---------------------------------------------------------------------------
  52. # Ignored suffixes
  53. # (do not forget '$' after each pattern)
  54. # arm
  55. /_from_arm$/d
  56. /_from_thumb$/d
  57. /_veneer$/d
  58. # ---------------------------------------------------------------------------
  59. # Ignored symbols (exact match)
  60. # (do not forget a space before and '$' after each pattern)
  61. # for LoongArch?
  62. / L0$/d
  63. # ppc
  64. / _SDA_BASE_$/d
  65. / _SDA2_BASE_$/d
  66. # MODULE_INFO()
  67. / __UNIQUE_ID_modinfo[0-9]*$/d
  68. # ---------------------------------------------------------------------------
  69. # Ignored patterns
  70. # (symbols that contain the pattern are ignored)
  71. # ppc stub
  72. /\.long_branch\./d
  73. /\.plt_branch\./d