casaroli commented on code in PR #19942: URL: https://github.com/apache/nuttx/pull/19942#discussion_r3912602615
########## include/nuttx/lib/elf.h: ########## @@ -278,6 +278,20 @@ struct mod_loadinfo_s FAR struct file *pinfile; #endif + /* The object's data base, from DT_PLTGOT. An FDPIC module runs with this + * in the PIC base register. + */ + + uintptr_t gotaddr; Review Comment: they cannot become one. `gotindex` is a section index into `shdr[]`, and the non-FDPIC paths use it for the GOT fixup in `libelf_loadfile()`, for the undefined-symbol write in `libelf_relocate()`, and for the D-Space region in **binfmt/elf.c**. `gotaddr` is the run-time base from DT_PLTGOT, which `libelf_bind()` reads after the load, so it is still zero at that check. the check does not need the merge anyway: an FDPIC object always has a .got, so the `|| fdpic` can go and both sites read `if (loadinfo->gotindex >= 0)`. i can rename `gotaddr` to `gotbase` if the two names are what read as redundant. -- 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]
