When LTO is enabled, the map file no longer provides a positive
indication of whether a given object file has contributed to the final
binary. Instead use nm to parse the debug data in the .elf file.
Co-Authored-By: Claude <noreply@anthropic.com>
Use a custom linker section to hold dynamic arrays such as the
usermod list. This provides an extensible solution for wider use
in the future (such as FX or Bus drivers), as well as IDF v5
compatibility.
PlatformIO doesn't clean out the libdir when usermods are disabled, so
they still appear in the LibBuilders() set. Ensure that we validate
only usermods that were actually deps for the build.