From: Philippe Waroquiers Date: Sun, 17 Aug 2014 13:33:57 +0000 (+0000) Subject: Add comments in getoff.c to clarify its intended usage. X-Git-Tag: svn/VALGRIND_3_10_0~177 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d73c4e2a34a4bf1216fd0452c9aea38ac9cee20d;p=thirdparty%2Fvalgrind.git Add comments in getoff.c to clarify its intended usage. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14299 --- diff --git a/auxprogs/getoff.c b/auxprogs/getoff.c index aed5f29d43..b209a1f097 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- + 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- 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 @@ void usage (char* progname) 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;