rem: goto loop_end;
add: goto symbol_found;
context: elf_lookup_symbol_address(addr_t address, addr_t *_baseAddress, const char **_symbolName,	const char **_imageName, bool *_exactMatch){	struct elf_image_info *image;	struct Elf32_Sym *symbolFound = NULL;	const char *symbolName = NULL;	addr_t deltaFound = INT_MAX;	bool exactMatch = false;	status_t status;	TRACE(("looking up %p\n", (void *)address));	mutex_lock(&sImageMutex);		image = find_image_at_address(address);		// get image that may contain the address	if (image != NULL) {		addr_t symbolDelta;		uint32 i;		int32 j;		TRACE((" image %p, base = %p, size = %p\n", image,			(void *)image->text_region.start, (void *)image->text_region.size));		if (image->debug_symbols != NULL) {			// search extended debug symbol table (contains static symbols)			TRACE((" searching debug symbols...\n"));			for (i = 0; i < image->num_debug_symbols; i++) {				struct Elf32_Sym *symbol = &image->debug_symbols[i];				if (symbol->st_value == 0					|| symbol->st_size >= image->text_region.size + image->data_region.size)					continue;				symbolDelta = address - (symbol->st_value + image->text_region.delta);				if (symbolDelta >= 0 && symbolDelta < symbol->st_size)					exactMatch = true;				if (exactMatch || symbolDelta < deltaFound) {					deltaFound = symbolDelta;					symbolFound = symbol;					symbolName = image->debug_string_table + symbol->st_name;					if (exactMatch)						break;				}			}		} else {			// search standard symbol lookup table			TRACE((" searching standard symbols...\n"));			for (i = 0; i < HASHTABSIZE(image); i++) {				for (j = HASHBUCKETS(image)[i]; j != STN_UNDEF; j = HASHCHAINS(image)[j]) {					struct Elf32_Sym *symbol = &image->syms[j];					if (symbol->st_value == 0						|| symbol->st_size >= image->text_region.size + image->data_region.size)						continue;					symbolDelta = address - (long)(symbol->st_value + image->text_region.delta);					if (symbolDelta >= 0 && symbolDelta < symbol->st_size)						exactMatch = true;					if (exactMatch || symbolDelta < deltaFound) {						deltaFound = symbolDelta;						symbolFound = symbol;						symbolName = SYMNAME(image, symbol);						if (exactMatch)							goto loop_end;					}				}			}		loop_end:		}	}	if (symbolFound != NULL) {		if (_symbolName)			*_symbolName = symbolName;		if (_imageName)			*_imageName = image->name;		if (_baseAddress)			*_baseAddress = symbolFound->st_value + image->text_region.delta;		if (_exactMatch)			*_exactMatch = exactMatch;		status = B_OK;	} else if (image != NULL) {		TRACE(("symbol not found!\n"));		if (_symbolName)			*_symbolName = NULL;		if (_imageName)			*_imageName = image->name;		if (_baseAddress)			*_baseAddress = image->text_region.start;		if (_exactMatch)			*_exactMatch = false;		status = B_OK;	} else {		TRACE(("image not found!\n"));		status = B_ENTRY_NOT_FOUND;	}	// Note, theoretically, all information we return back to our caller	// would have to be locked - but since this function is only called	// from the debugger, it's safe to do it this way	mutex_unlock(&sImageMutex);	return status;}