Add comments in getoff.c to clarify its intended usage.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14299 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/auxprogs/getoff.c b/auxprogs/getoff.c
index aed5f29..b209a1f 100644
--- a/auxprogs/getoff.c
+++ b/auxprogs/getoff.c
@@ -22,6 +22,28 @@
The GNU General Public License is contained in the file COPYING.
*/
+/* This file is used to generate target executable(s) getoff-<platform>
+ In a bi-arch setup, this is used to build 2 executables
+ (for the primary and secondary platforms).
+
+ This program uses user space libraries to retrieve some platform
+ dependent offsets needed for Valgrind core, but that cannot (easily)
+ be retrieved by Valgrind core.
+
+ This is currently used only for handling the gdbsrv QGetTlsAddr query :
+ it only computes and outputs lm_modid_offset in struct link_map
+ of the dynamic linker. In theory, we should also compute the offset needed
+ to get the dtv from the thread register/pointer/...
+ Currently, the various valgrind-low-xxxxxx.c files are hardcoding this
+ offset as it is deemed (?) stable, and there is no clear way how to
+ compute this dtv offset.
+
+ The getoff-<platform> executable will be launched automatically by
+ Valgrind gdbserver when the first QGetTlsAddr query is retrieved.
+
+ On plaforms that do not support __thread and/or that do not provide
+ dlinfo RTLD_DI_TLS_MODID, this executable produces no output. */
+
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
@@ -63,13 +85,7 @@
progname);
}
-/* Currently, only computes and output lm_modid_offset in struct link_map
- of the dynamic linker. In theory, we should also compute the offset needed
- to get the dtv from the thread register/pointer/...
- Currently, the various valgrind-low-xxxxxx.c files are hardcoding this
- offset as it is deemed (?) stable, and there is no clear way how to
- compute this dtv offset.
-*/
+
int main (int argc, char** argv)
{
int i;