I've got an OTA program that use and link against these libs (among others): libssl, libpwm and libdriver.
But depending on if I link with the option gc-section (to remove unused code), or depending on the libraries I link against, my program crashes to Fatal Exception (0) right after boot, without executing any line of my code. Functions of the libs are even never called (just used them in volountarly dead code to force the linker to link them during my investigation).
Or it seems like removing or adding dead code breaks crashes the ESP...
My app works perfectly fine when compiled in non-OTA version.
Behavior is the same with NONOS-SDK v2.2 and v3.0, on ESP8266 on a WROOM-02 module, 16MBits and 512+512 map.
What's wrong ? Is there any conflicts between PWM and SSL lib ? Related to NMI/hardware timer ? Magic sections in theses libs ?
Removing dead code sould not change the behavior. And linking a library whose functions are not called should not break the app. That's why I suspect a compilation/linking issue, or some obscure broken code relocation...
I'm going crazy, I can't see the logic: could you help me understand and fix this behaviour ?
Here is are the results of my investigastions.
The "y" stands for "yes, I linked against this lib or enabled gc-sections", and "n" is for "no".
By "OK", I mean my app start and runs fine.
Below, it's built for OTA-version.
Empty app (just implement user_init & co. with a printf. Other objects are compiled but functions are never called):