Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

s390/module: Provide find_section() helper

Provide find_section() helper function which can be used to find a
section by name, similar to other architectures.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

authored by

Heiko Carstens and committed by
Jason A. Donenfeld
a919390e 94c7755b

+14
+14
arch/s390/include/asm/module.h
··· 38 38 #endif /* CONFIG_FUNCTION_TRACER */ 39 39 }; 40 40 41 + static inline const Elf_Shdr *find_section(const Elf_Ehdr *hdr, 42 + const Elf_Shdr *sechdrs, 43 + const char *name) 44 + { 45 + const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; 46 + const Elf_Shdr *s, *se; 47 + 48 + for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) { 49 + if (strcmp(name, secstrs + s->sh_name) == 0) 50 + return s; 51 + } 52 + return NULL; 53 + } 54 + 41 55 #endif /* _ASM_S390_MODULE_H */