[email protected] writes: > +/* The following callback has to be implemented in backend if arch.h > + * defines ARCH_HAVE_GET_SYM_INFO. > + * > + * This is called for every PLT relocation R in ELF file LTE, that > + * ltrace is about to add to it's internal representation of the > + * program under trace. > + * The corresponding PLT entry is for sym_index-th relocation in the file. > + * > + * If this function returns plt_default, PLT address is obtained by > + * calling arch_plt_sym_val, and symbol is allocated. If plt_ok or > + * plt_default are returned, the chain of symbols passed back in RET > + * is added to library under construction. */ > +int arch_get_sym_info(struct ltelf *lte, const char *filename, > + GElf_Rela *rela, GElf_Sym *sym, size_t sym_index); > +
The last paragraph doesn't seem to apply to this function. The comment also doesn't really explain what the function should do and what are legitimate return values. Presumably it should initialize RELA and SYM? If that is so, then sym_index (as input argument) should come before them. I'm fine with the overall intention of making this configurable. > + err = arch_get_sym_info(lte, filename, &rela, &sym, i); > + if (err) > + continue; /* Skip this entry. */ Error signalling should be 0 for success or a negative value for failure. That's how it's done in other cases. This particular code should be: + if (arch_get_sym_info(lte, filename, &rela, &sym, i) < 0) + continue; /* Skip this entry. */ Thanks, PM _______________________________________________ Ltrace-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/ltrace-devel
