Open smaeul opened 3 years ago
This would have been amazingly useful to know.. a while a go 😂 Thankfully adding thunks is not too hard at all.
That said, this is super useful to know in case I end up regenerating any of the code again. I've done that a fair few times already when trying different ideas.
Here's a suggestion for anyone wanting to look at the pre-compiled files in Ghidra. This is most useful if you haven't already made a bunch of annotations; I don't know how to copy those over. So it's not really aimed at this repo, per se, but here's where the action seems to be.
make ARCH=arm64 rockchip_linux_defconfig
to start with a kernel config that builds the EBC driver.make ARCH=arm64 nconfig
and enableCONFIG_DEBUG_INFO_DWARF4
(at "Kernel hacking" -> "Compile-time checks and compiler options" -> "Generate dwarf4 debuginfo"). DWARF4 is the newest debug info format that Ghidra understands, but recent GCC will generate DWARF5 by default.make ARCH=arm64
to compile the kernel. If it fails, that is fine, as long asdrivers/gpu/drm/rockchip/ebc-dev/built-in.a
gets created.aarch64-linux-gnu-ld -r -o drivers/gpu/drm/rockchip/ebc-dev/built-in.o --whole-archive drivers/gpu/drm/rockchip/ebc-dev/built-in.a
.This will create a single file,
built-in.o
, that includes all of the C and pre-compiled source for the driver, so everything gets loaded together in one code browser, and you don't have to worry about function imports and thunks and whatnot.