FreeBSD/cddl/contrib/opensolaris/tools/ctf/cvt/output.c
/*
 * See if this iidesc matches the ELF symbol data we pass in.
 *
 * A fuzzy match is where we have a local symbol matching the name of a
 * global type description. This is common when a mapfile is used for a
 * DSO, but we don't accept it by default.
 *
 * A weak fuzzy match is when a weak symbol was resolved and matched to
 * a global type description.
 */
See if this iidesc matches the ELF symbol data we pass in.
A fuzzy match is where we have a local symbol matching the name of a
global type description. This is common when a mapfile is used for a
DSO, but we don't accept it by default.

A weak fuzzy match is when a weak symbol was resolved and matched to
a global type description.
See if this iidesc matches the ELF symbol data we pass in . A fuzzy match is where we have a local symbol matching the name of a global type description . This is common when a mapfile is used for a DSO but we don ' t accept it by default . A weak fuzzy match is when a weak symbol was resolved and matched to a global type description .
static int
matching_iidesc(void *arg1, void *arg2)
{
	iidesc_t *iidesc = arg1;
	iidesc_match_t *match = arg2;
	if (streq(iidesc->ii_name, match->iim_name) == 0)
		return (0);
	switch (iidesc->ii_type) {
	case II_GFUN:
	case II_GVAR:
		if (match->iim_bind == STB_GLOBAL) {
			match->iim_ret = iidesc;
			return (-1);
		} else if (match->iim_fuzzy && match->iim_ret == NULL) {
			match->iim_ret = iidesc;
			return (0);
		}
		break;
	case II_SFUN:
	case II_SVAR:
		if (match->iim_bind == STB_LOCAL &&
		    match->iim_file != NULL &&
		    streq(iidesc->ii_owner, match->iim_file)) {
			match->iim_ret = iidesc;
			return (-1);
		}
		break;
	default:
		break;
	}
	return (0);
}
static int matching_iidesc ( void * arg1 , void * arg2 ) { iidesc_t * iidesc = arg1 ; iidesc_match_t * match = arg2 ; if ( streq ( iidesc -> ii_name , match -> iim_name ) == 0 ) return ( 0 ) ; switch ( iidesc -> ii_type ) { case II_GFUN : case II_GVAR : if ( match -> iim_bind == STB_GLOBAL ) { match -> iim_ret = iidesc ; return ( -1 ) ; } else if ( match -> iim_fuzzy && match -> iim_ret == NULL ) { match -> iim_ret = iidesc ; return ( 0 ) ; } break ; case II_SFUN : case II_SVAR : if ( match -> iim_bind == STB_LOCAL && match -> iim_file != NULL && streq ( iidesc -> ii_owner , match -> iim_file ) ) { match -> iim_ret = iidesc ; return ( -1 ) ; } break ; default : break ; } return ( 0 ) ; }
See if this iidesc matches the ELF symbol data we pass in.
See if this iidesc matches the ELF symbol data we pass in .
/* continue to look for strong match */