During compilation, the compiler may generate various files, such as object file, libraray file and preprocessed file. Among these, preprocessed file contain the valuable information because the compiler parses the representation macro into the readable statement.
To get preprocessed in the Linux kernel, we have to modify Makefile. The following is the patchset to generate preprocessed in the Linux kernel (v6.10).
diff --git a/Makefile b/Makefile
index 9b88055ea112..13369bde03ba 100644
--- a/Makefile
+++ b/Makefile
@@ -548,6 +548,7 @@ KBUILD_CFLAGS += -funsigned-char
KBUILD_CFLAGS += -fno-common
KBUILD_CFLAGS += -fno-PIE
KBUILD_CFLAGS += -fno-strict-aliasing
+KBUILD_CFLAGS += -save-temps=obj
KBUILD_CPPFLAGS := -D__KERNEL__
KBUILD_RUSTFLAGS := $(rust_common_flags) \
After above patch set is applied to your source tree in Linux kernel, we can identify that the preprocessed files are generated during compilation:
out-riscv64/crypto$ ls
aead.i algapi.s bpf_crypto_skcipher.s compress.s lskcipher.s scatterwalk.s
aead.o api.i cipher.i crypto_engine.i proc.i skcipher.i
aead.s api.o cipher.o crypto_engine.o proc.o skcipher.o
ahash.i api.s cipher.s crypto_engine.s proc.s skcipher.s
algapi.i bpf_crypto_skcipher.i compress.i lskcipher.i scatterwalk.i
algapi.o bpf_crypto_skcipher.o compress.o lskcipher.o scatterwalk.o
Note that *.i is preprocessed file, such as aead.i, api.i and so on.
'리눅스 커널의 구조와 원리 > 2. 라즈베리 파이 설정' 카테고리의 다른 글
gzip의 분할 압축 명령어 사용하기 (0) | 2023.12.01 |
---|---|
[GIT] initial configuration GIT (0) | 2023.09.11 |
[라즈베리 파이 4B] 라즈비안 커널 빌드 (크로스 컴파일러 - cross compile) (0) | 2023.09.11 |
64비트 기존 라즈비안 이미지 위치 (0) | 2023.09.08 |
[정보] 라즈비안 이미지 백업 위치 (0) | 2023.08.27 |