casaroli opened a new pull request, #3975: URL: https://github.com/apache/nuttx-apps/pull/3975
depends-on: apache/nuttx/pull/20789 ## Summary A test of the GOT relocations of a program, for the arm64 module loader of #20789. The linker makes no GOT for a relocatable object, but its code can still use the GOT relocations: all code built with `-fPIC` does, and code that takes the address of an undefined weak symbol. `testing/libc/gotreloc` is a program built with `-fPIC`. It checks the GOT slots that the loader makes: each slot holds the address of its symbol, a write through a slot reaches the data, a libc function comes through the GOT, and undefined weak symbols are NULL. The test tests the loader when the program is loaded: in a kernel build, or as a module. `CONFIG_TESTING_LIBC_GOTRELOC` depends on `ARCH_ARM64`, because the test uses arm64 instructions. ## Impact A new test program in `testing/libc`. Off by default. No change to any other code. ## Testing A program built with `-fPIC` on `qemu-armv8a:knsh` (QEMU, HVF), master 6b9b216ff30, at the earlier commit 02295bc00 of this branch. The commit here differs only in the `STACKSIZE` line of the Makefile. The run on this commit is not finished. | Check | master | with #20789 | |---|---|---| | Load the program | `exec failed: 22` | runs | | GOT slot holds the address of the data | - | PASS | | A write through the slot reaches the data | - | PASS | | libc function address through the GOT | - | PASS | | Undefined weak data is NULL | - | PASS | | Undefined weak function is NULL | - | PASS | ostest exits with status 0 on `qemu-armv8a:knsh` with #20789. Builds with the test on, with #20789, on this commit, each OK: `qemu-armv8a:knsh` and `qemu-armv8a:nsh`, with Make and with CMake. Builds with the test off, on the earlier commit, each OK: `qemu-armv8a:knsh`, `rv-virt:nsh`, `sim:nsh`. `CONFIG_TESTING_LIBC_GOTRELOC` depends on `ARCH_ARM64`, so other architectures do not have the option. CI does not run this test. `qemu-armv8a:citest` is a flat build with no ELF loading, and CI only builds `qemu-armv8a:knsh`, with this option off. `tools/checkpatch.sh -c -u -m -g` passes. -- 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]
