|
Some checks are pending
Build Documentation / build-html (push) Waiting to run
Docker-Linux / push (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
libelf_elfsize() takes textalign and dataalign from the section headers, which only the ET_REL path walks. An ET_DYN object is sized from its program headers instead, so both fields stay at zero, and the allocation a few lines later asks for that alignment: loadinfo->textalloc = lib_memalign(loadinfo->textalign, ...); Zero is not a valid alignment, and every path that receives it divides by it. mm_memalign() accepts zero as a power of two, because 0 & -0 is 0, then takes the "alignment <= MM_ALIGN" branch and evaluates "((uintptr_t)ptr) % alignment" in a DEBUGASSERT. With CONFIG_MM_HEAP_MEMPOOL and a pool that fits the request the object never reaches that branch and gets ALIGN_UP(blk, 0) instead, which is ((blk - 1) / 0) * 0. On Cortex-M this is usually invisible: UDIV returns zero for a division by zero unless CCR.DIV_0_TRP is set, which NuttX does not set, so the assertion compares zero against zero and passes. It is a SIGFPE on the simulator, and the mempool path returns a null pointer wherever the division yields zero, which the loader reports as -ENOMEM. Ask for a natural word when the program headers gave nothing. p_align is the linker's page granularity, not a section requirement, so honouring it would cost a page per module for no gain, and the sections of a shared object need no more than a word. Built for mps3-an547:picostest, which is CONFIG_ELF with CONFIG_PIC. Runtime evidence on hardware follows. Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com> |
||
|---|---|---|
| .github | ||
| arch | ||
| audio | ||
| binfmt | ||
| boards | ||
| cmake | ||
| crypto | ||
| Documentation | ||
| drivers | ||
| dummy | ||
| fs | ||
| graphics | ||
| include | ||
| libs | ||
| mm | ||
| net | ||
| openamp | ||
| pass1 | ||
| sched | ||
| syscall | ||
| tools | ||
| video | ||
| wireless | ||
| .asf.yaml | ||
| .codespell-ignore-lines | ||
| .codespellrc | ||
| .editorconfig | ||
| .gitignore | ||
| .gitmessage | ||
| .pre-commit-config.yaml | ||
| .yamllint | ||
| AUTHORS | ||
| CMakeLists.txt | ||
| CONTRIBUTING.md | ||
| INVIOLABLES.md | ||
| Kconfig | ||
| LICENSE | ||
| Makefile | ||
| NOTICE | ||
| README.md | ||
| ReleaseNotes | ||
Apache NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOSs (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()).
For brevity, many parts of the documentation will refer to Apache NuttX as simply NuttX.
Getting Started
First time on NuttX? Read the Getting Started guide! If you don't have a board available, NuttX has its own simulator that you can run on terminal.
Documentation
You can find the current NuttX documentation on the Documentation Page.
Alternatively, you can build the documentation yourself by following the Documentation Build Instructions.
The old NuttX documentation is still available in the Apache wiki.
Supported Boards
NuttX supports a wide variety of platforms. See the full list on the Supported Platforms page.
Contributing
If you wish to contribute to the NuttX project, read the Contributing guidelines for information on Git usage, coding standard, workflow and the NuttX principles.
License
The code in this repository is under either the Apache 2 license, or a license compatible with the Apache 2 license. See the License Page for more information.