Go to file
yinshengkai 97096bed83 libs: fix the problem that the address obtained in thumb mode cannot be executed.
The lowest bit of the thumb instruction is 1 by default, which is used to distinguish arm instructions and thumb instructions.
Fixed the problem of misalignment of symbol table when performing binary search

In arm, the lowest bit of the instruction is 1, which is a thumb instruction, and 0, which is an arm instruction.
The nm command was used in mkallsym.sh before, and the result it will return will set the lowest bit of the thumb instruction to 0. There will be a one-byte deviation during binary search, so mkallsyms.py will also set the lowest bit to 0 according to the previous format.
```sh
arm-none-eabi-nm -Cn nuttx | grep hello
0801c384 T hello_main
arm-none-eabi-objdump nuttx -t |grep hello
0801c384 g F .text 0000004c hello_main
arm-none-eabi-readelf nuttx -s |grep hello
4558: 0801c385 76 FUNC GLOBAL DEFAULT 1 hello_main
```

However, in the following case, when you need to find the function address according to the symbol name and execute the corresponding function, the lowest address obtained is 0. It will follow the arm instruction, causing an exception.
```c
void sym_test(void)
{
   printf("call sym_test\n");
}

int main(int argc, FAR char *argv[])
{
   FAR void *addr = sym_test;
   printf("sym_test:%p %pS\n",addr, addr);
   printf("sym_test - 1: %pS\n", (char *)addr - 1);
   printf("sym_test + 1: %pS\n", (char *)addr + 1);

   size_t size;
   void (*func)(void);
   const struct symtab_s *sym = allsyms_findbyname("sym_test", &size);
   printf("sym_test:%p %pS\n",sym, sym);
   func = sym->sym_value;
   func();

   return 0;
}
```

Therefore, you need to change mkallsyms.py back to the correct result and correct the binary search.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-01-04 09:22:57 -08:00
.github build(deps): bump actions/setup-python from 4 to 5 2023-12-10 21:53:27 -08:00
arch tools: support sorting symbol tables by name 2024-01-04 09:22:57 -08:00
audio Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
binfmt log messages of binfmt are very much. 2023-12-29 17:36:47 +08:00
boards risc-v/k230: kernel build for CanMV-K230 board 2023-12-31 07:26:45 -08:00
cmake Revert "cmake: restore old behavior for savedefconfig" 2023-12-20 16:05:19 +01:00
crypto sched: explicitly select the cpuload clock source configuration 2023-11-01 09:27:56 +08:00
Documentation risc-v/k230: revise canmv230 docmentations 2024-01-01 04:01:28 -08:00
drivers rptun: Select OPENMAP under RPTUN 2023-12-28 11:08:57 +08:00
dummy build: add initial cmake build system 2023-07-08 13:50:48 +08:00
fs fs: procfs add poll support 2023-12-26 19:23:13 -08:00
graphics poll: pollsetup should notify only one fd passd by caller 2023-11-21 09:07:17 +01:00
include make 64-bit time_t back to unsigned 2023-12-30 08:48:43 -08:00
libs libs: fix the problem that the address obtained in thumb mode cannot be executed. 2024-01-04 09:22:57 -08:00
mm fs: procfs add poll support 2023-12-26 19:23:13 -08:00
net net/udp: set ipv6 remote addr before udpip_hdrsize 2023-12-27 12:24:59 +01:00
openamp rptun: Select OPENMAP under RPTUN 2023-12-28 11:08:57 +08:00
pass1
sched fs: procfs add poll support 2023-12-26 19:23:13 -08:00
syscall sched/semaphore: Move named semaphores to user space 2023-11-27 04:52:54 -08:00
tools libs: fix the problem that the address obtained in thumb mode cannot be executed. 2024-01-04 09:22:57 -08:00
video build: add initial cmake build system 2023-07-08 13:50:48 +08:00
wireless netdev/ipv6: Move xxx_ipv6multicast from arch to common code 2023-12-16 05:26:16 -08:00
.asf.yaml
.gitignore Documentation: port warnings_filter Sphinx extension from Zephyr 2023-11-28 09:18:29 -08:00
.yamllint
AUTHORS AUTHORS: add Tomek CEDRO to the list 2023-03-07 14:15:55 +01:00
CMakeLists.txt cmake: NUTTX_COMMON_DIR must be set after .config definitions are included 2023-12-12 16:48:08 -03:00
CONTRIBUTING.md Remove the tail spaces from all files except Documentation 2023-02-26 13:24:24 -08:00
INVIOLABLES.md
Kconfig xtensa/esp/rmt: Add the lower-half implementation of the RMT driver 2023-12-24 16:38:06 -08:00
LICENSE free disk space action added to fix docker image build issue 2023-12-08 14:42:17 +01:00
Makefile
NOTICE
README.md Gathering community recommendations 2023-10-28 13:55:56 +08:00
ReleaseNotes Documentation: move ReleaseNotes 2023-09-26 20:41:00 +08:00

POSIX Badge License Issues Tracking Badge Contributors GitHub Build Badge Documentation Badge

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.