mirror of
https://github.com/apache/nuttx.git
synced 2026-09-09 18:36:37 +00:00
gotindex named the .got section header, and every user then reached through shdr[] for what it actually wanted. Only one of the five wanted the index. gotbase and gotsize say it directly. gotsize is the extent of .got and is also what says the object has one, and gotbase is where the GOT ended up: the placed address of .got for an ordinary object, or DT_PLTGOT for an FDPIC one, which libelf_bind() already reads. Both are set in libelf_loadfile(), after the sections are placed, so gotbase is the address the object will be read at rather than the one it was linked for. The GOT walk in libelf_loadfile() now runs only when there is a base, which also keeps it off an FDPIC object. An FDPIC object's sections are never placed, so .got carried a link time sh_addr there, and the walk read and wrote through it. Its GOT is relocated through its own relocations. The check that gates libelf_xipacquire() runs before the load, when neither field is set, so it looks the section up by name. It hands the index it found to libelf_loadfile(), which is the only reason that function takes one: the object is searched once, not twice. One behaviour changes: a .got that exists but is empty now reads as no GOT. There is nothing for any of the five users to do with an empty one. Built for pimoroni-pico-2-plus with CONFIG_PIC, CONFIG_ELF and CONFIG_LIBC_ELF, and for mps3-an547:bl, which is the board that read the index. Run on QEMU with mps3-an547:picostest, which loads PIC ELF modules from a romfs: hello prints, and ostest reaches the timed mutex test, the same as before the change. Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com> |
||
|---|---|---|
| .. | ||
| android | ||
| arpa | ||
| crypto | ||
| cxx | ||
| net | ||
| netinet | ||
| netpacket | ||
| nuttx | ||
| ssp | ||
| sys | ||
| .gitignore | ||
| aio.h | ||
| alloca.h | ||
| assert.h | ||
| byteswap.h | ||
| ctype.h | ||
| debug.h | ||
| dirent.h | ||
| dlfcn.h | ||
| dsp.h | ||
| dspb16.h | ||
| elf.h | ||
| elf32.h | ||
| elf64.h | ||
| endian.h | ||
| err.h | ||
| errno.h | ||
| execinfo.h | ||
| fcntl.h | ||
| fixedmath.h | ||
| fnmatch.h | ||
| ftw.h | ||
| gcov.h | ||
| getopt.h | ||
| glob.h | ||
| grp.h | ||
| hex2bin.h | ||
| iconv.h | ||
| ifaddrs.h | ||
| imx_container.h | ||
| inttypes.h | ||
| iso646.h | ||
| langinfo.h | ||
| libgen.h | ||
| libintl.h | ||
| limits.h | ||
| locale.h | ||
| lzf.h | ||
| malloc.h | ||
| mqueue.h | ||
| netdb.h | ||
| nl_types.h | ||
| nxflat.h | ||
| obstack.h | ||
| poll.h | ||
| pthread.h | ||
| pty.h | ||
| pwd.h | ||
| regex.h | ||
| resolv.h | ||
| sched.h | ||
| search.h | ||
| semaphore.h | ||
| shadow.h | ||
| signal.h | ||
| spawn.h | ||
| stdbool.h | ||
| stddef.h | ||
| stdint.h | ||
| stdio.h | ||
| stdlib.h | ||
| stdnoreturn.h | ||
| string.h | ||
| strings.h | ||
| syscall.h | ||
| syslog.h | ||
| termios.h | ||
| threads.h | ||
| time.h | ||
| ulimit.h | ||
| unistd.h | ||
| utime.h | ||
| uuid.h | ||
| wait.h | ||
| wchar.h | ||
| wctype.h | ||