ldube opened a new pull request, #19778: URL: https://github.com/apache/nuttx/pull/19778
## Summary Implement architecture-specific ELF header definitions and relocation handling for the MIPS architecture to enable loadable modules. Fixes #19178. Changes include: - Add `arch/mips/include/elf.h` with MIPS ELF relocation types and architecture-specific ELF data structures (`arch_elfdata_s`). - Implement `libs/libc/machine/mips/arch_elf.c` containing `up_checkarch`, `up_relocate`, and `up_relocateadd` functions handling `R_MIPS_NONE`, `R_MIPS_32`, `R_MIPS_26`, `R_MIPS_HI16`, and `R_MIPS_LO16` relocations. - Integrate MIPS machine-specific C library support in `libs/libc/machine/mips/Make.defs`. - Update `LDMODULEFLAGS` in `arch/mips/src/mips32/Toolchain.defs` to include the little-endian (`-EL`) flag. - Update `up_coherent_dcache` for proper cache synchronization on JZ4780. *Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* ## Testing Copy ./apps/bin/chardev formated USB stick Plug stick into CI20 USB port Enable the Module Example and set /dev/sda as the Block driver device path Build nuttx. (Build used to fail before this change) Boot the nuttx image on the CI20 and run "module" to test. ``` NuttShell (NSH) NuttX-13.0.0 nsh> module Mounting vfat filesystem at target=/mnt/vfat module_initialize chardev_read: Returning 36 bytes chardev_read: Returning (0x8008fe48): 0000 48 69 20 74 68 65 72 65 2c 20 61 70 70 73 2f 65 Hi there, apps/e 0010 78 61 6d 70 6c 65 73 2f 6d 6f 64 75 6c 65 20 74 xamples/module t 0020 65 73 74 0a est. main: Bytes read (0x8008fe48): 0000 48 69 20 74 68 65 72 65 2c 20 61 70 70 73 2f 65 Hi there, apps/e 0010 78 61 6d 70 6c 65 73 2f 6d 6f 64 75 6c 65 20 74 xamples/module t 0020 65 73 74 0a est. chardev_write: Writing 26 bytes chardev_write: Writing (0x80082030): 0000 48 69 20 74 68 65 72 65 20 69 6e 73 74 61 6c 6c Hi there install 0010 65 64 20 64 72 69 76 65 72 0a ed driver. main: Bytes written (0x80082030): 0000 48 69 20 74 68 65 72 65 20 69 6e 73 74 61 6c 6c Hi there install 0010 65 64 20 64 72 69 76 65 72 0a ed driver. module_uninitialize main: Read 36 bytes main: Wrote 26 bytes nsh> ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
