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



On Nov 7,  8:35am, martin%duskware.de@localhost (Martin Husemann) wrote:
-- Subject: 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;

	/* filter out non $? $?\.* */
  	if (name[0] != '$' || name[1] == '\0' || (name[2] != '\0' &&
	    || name[2] != '.'))
  		return Other;

	switch (name[1]) {
	case 'a':	/* match $a and $a\.* */
  		return ArmStart;
	case 'd':	/* match $d and $d\.* */
  		return DataStart;
  	case 't':	/* match $t and $t\.* */
  		return ThumbStart;
	default:
  		return Other;
	}
    }

christos


Home | Main Index | Thread Index | Old Index