/* Convert a section name to the function/data attribute .init.text => __init .cpuinit.data => __cpudata .memexitconst => __memconst etc.  */
static char* sec2annotation(const char *s)
/* Convert a section name to the function/data attribute .init.text => __init .cpuinit.data => __cpudata .memexitconst => __memconst etc.  */
static char* sec2annotation(const char *s)
{
	if (match(s, init_exit_sections)) {
		char *p = malloc(20);
		char *r = p;
		*p++ = '_';
		*p++ = '_';
		if (*s == '.')
			s++;
		while (*s && *s != '.')
			*p++ = *s++;
		*p = '\0';
		if (*s == '.')
			s++;
		if (strstr(s, "rodata") != NULL)
			strcat(p, "const ");
		else if (strstr(s, "data") != NULL)
			strcat(p, "data ");
		else
			strcat(p, " ");
		return r;
	} else {
		return "";
	}
}