Skip to content

Files

Latest commit

Mar 26, 2023
3f8b05f · Mar 26, 2023

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 25, 2023
Mar 26, 2023

Requirement

  • build kernel using clang into binary successfully
  • golang
  • The related kernel module are enabled in Linux kernel configuration

Build Linux kernel into LLVM Bitcode

go run path/of/v5.12/KernelBitcode.go --help
  1. Build Kernel with clang
make LLVM=1 -j16
  1. Generate script to build kernel into LLVM Bitcode
go run path/of/v5.12/KernelBitcode.go
  1. Get LLVM Bitcode
bash build.sh

built-in.bc is in each directory. All external modules are in the end of build.sh. Now you can perform analysis on those LLVM bitcode files.