Packages/uClibc/patches/30 dlsym-verbose-dev.diff

From Organic Design wiki
  • When DEBUG=yes in config/options, allows creation of the file

/dlsym.log which contains all the symbols from libraries that are accessed via dlopen()/dlsym()/dlclose() procedure (and so the symbols are not directly accessible from the resulting binary).

Intended use is to create a file which can be sort|uniq'd into an alphabetically-ordered list, so that libstrip can be used on those libraries that are used by programs that use dlsym(), without stripping out required symbols.

--- uClibc/ldso/libdl/libdl.c 2007-02-05 03:01:12.000000000 +0900 +++ uClibc/ldso/libdl/libdl.c 2007-02-05 03:05:10.000000000 +0900 @@ -406,6 +406,13 @@

	ElfW(Addr) from;
	struct dyn_elf *rpnt;
	void *ret;

+#ifdef _DLSYM_TRACE_NAME + FILE *log = fopen("/dlsym.log", "a"); + + fprintf(log, "%s\n", name); + fflush(log); + fclose(log); +#endif

	handle = (struct dyn_elf *) vhandle;