1 // SPDX-License-Identifier: GPL-2.0
2 static int find_map(void **start, void **end, const char *name)
8 maps = fopen("/proc/self/maps", "r");
10 fprintf(stderr, "cannot open maps\n");
14 while (!found && fgets(line, sizeof(line), maps)) {
17 /* We care only about private r-x mappings. */
18 if (2 != sscanf(line, "%p-%p r-xp %*x %*x:%*x %*u %n",
24 if (!strncmp(&line[m], name, strlen(name)))