NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-arm/49299: earmv7hfeb kernels can not load modules



The following reply was made to PR port-arm/49299; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: port-arm/49299: earmv7hfeb kernels can not load modules
Date: Fri, 7 Nov 2014 09:30:39 +0100

 Here is the optimized version of the match function (I'll fix the regexp
 in the comments, heh)
 
 Martin
 
 static enum be8_magic_sym_type
 be8_sym_type(const char *name, int info)
 {
 	if (ELF_ST_BIND(info) != STB_LOCAL)
 		return Other;
 	if (ELF_ST_TYPE(info) != STT_NOTYPE)
 		return Other;
 	if (name[0] != '$')
 		return Other;
 
 	/* match $a and $a\.* */
 	if (name[1] == 'a' && (name[2] == 0 || name[2] == '.'))
 		return ArmStart;
 
 	/* match $t and $t\.* */
 	if (name[1] == 't' && (name[2] == 0 || name[2] == '.'))
 		return ThumbStart;
 
 	/* match $d and $d\.* */
 	if (name[1] == 'd' && (name[2] == 0 || name[2] == '.'))
 		return DataStart;
 
 	return Other;
 }
 
 


Home | Main Index | Thread Index | Old Index