Open FauthD opened 2 years ago
Hi Beta68, with gcc 9.4 native on N2+ it does not complain about the sections. Perhaps this linker does not check for this?
Nevertheless this could cause crashes.
PS: I saw you added some dts files (same names as I added, might cause merge issues when I send a pull request). Many regards, Dieter
Hi Beta68, When I build here, I get some "Section mismatch" warnings from the linker. First I thought it was from one of my changes, but they also show up with your code. Without the DEBUG macro below it only shows a short summary that can be easily overlooked.
I analyzed the sources and fixed it in my fork: "Fix linker warning "mismatched sections". Could even cause a crash." fc5a0d860c8e60b7f2a249e02041a2bebfbb9e15. Root cause are some init and initdata attributes. These tell the kernel this code is only used at startup, so it can later free this memory. Can be dangerous and cause a crash.
I currently build with the toolchain from CoreElec (GCC 10.2), but I think older linkers should complain as well. Tomorrow I can check building native on my N2+.
There a more changes than this one. If you want to merge code back, we probably should talk.... Many regards, Dieter
My make line:
make CONFIG_DEBUG_SECTION_MISMATCH=y -j6 >k.log
Section Mismatch