head/libexec/rtld-elf/rtld.c
/*
 * Search for symbol using SysV hash function.
 * obj->buckets is known not to be NULL at this point; the test for this was
 * performed with the obj->valid_hash_sysv assignment.
 */
Search for symbol using SysV hash function.
obj->buckets is known not to be NULL at this point; the test for this was
performed with the obj->valid_hash_sysv assignment.
Search for symbol using SysV hash function . obj - > buckets is known not to be NULL at this point ; the test for this was performed with the obj - > valid_hash_sysv assignment .
static int
symlook_obj1_sysv(SymLook *req, const Obj_Entry *obj)
{
	unsigned long symnum;
	Sym_Match_Result matchres;
	matchres.sym_out = NULL;
	matchres.vsymp = NULL;
	matchres.vcount = 0;
	for (symnum = obj->buckets[req->hash % obj->nbuckets];
	    symnum != STN_UNDEF; symnum = obj->chains[symnum]) {
		if (symnum >= obj->nchains)
			return (ESRCH);	
		if (matched_symbol(req, obj, &matchres, symnum)) {
			req->sym_out = matchres.sym_out;
			req->defobj_out = obj;
			return (0);
		}
	}
	if (matchres.vcount == 1) {
		req->sym_out = matchres.vsymp;
		req->defobj_out = obj;
		return (0);
	}
	return (ESRCH);
}
static int symlook_obj1_sysv ( SymLook * req , const Obj_Entry * obj ) { unsigned long symnum ; Sym_Match_Result matchres ; matchres . sym_out = NULL ; matchres . vsymp = NULL ; matchres . vcount = 0 ; for ( symnum = obj -> buckets [ req -> hash % obj -> nbuckets ] ; symnum != STN_UNDEF ; symnum = obj -> chains [ symnum ] ) { if ( symnum >= obj -> nchains ) return ( ESRCH ) ; if ( matched_symbol ( req , obj , & matchres , symnum ) ) { req -> sym_out = matchres . sym_out ; req -> defobj_out = obj ; return ( 0 ) ; } } if ( matchres . vcount == 1 ) { req -> sym_out = matchres . vsymp ; req -> defobj_out = obj ; return ( 0 ) ; } return ( ESRCH ) ; }
Search for symbol using SysV hash function.
Search for symbol using SysV hash function .
/* Bad object */