tree:
https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git
arm64/ftrace-with-regs
head: 11b2e25aa401d87a34c18d31b6e520dd2cd00706
commit: 11b2e25aa401d87a34c18d31b6e520dd2cd00706 [2/2] module/ftrace: handle
patchable-function-entry
config: parisc-c3000_defconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 7.4.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 11b2e25aa401d87a34c18d31b6e520dd2cd00706
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/parisc/kernel/module.c: In function 'module_finalize':
> arch/parisc/kernel/module.c:954:42: error:
'FTRACE_CALLSITE_SECTION' undeclared (first use in this function); did you mean
'PER_CPU_BASE_SECTION'?
if (symindex != -1 && !strcmp(secname,
FTRACE_CALLSITE_SECTION)) {
^~~~~~~~~~~~~~~~~~~~~~~
PER_CPU_BASE_SECTION
arch/parisc/kernel/module.c:954:42: note: each undeclared identifier is reported only
once for each function it appears in
vim +954 arch/parisc/kernel/module.c
884
885 register_unwind_table(me, sechdrs);
886
887 /* haven't filled in me->symtab yet, so have to find it
888 * ourselves */
889 for (i = 1; i < hdr->e_shnum; i++) {
890 if(sechdrs[i].sh_type == SHT_SYMTAB
891 && (sechdrs[i].sh_flags & SHF_ALLOC)) {
892 int strindex = sechdrs[i].sh_link;
893 symindex = i;
894 /* FIXME: AWFUL HACK
895 * The cast is to drop the const from
896 * the sechdrs pointer */
897 symhdr = (Elf_Shdr *)&sechdrs[i];
898 strtab = (char *)sechdrs[strindex].sh_addr;
899 break;
900 }
901 }
902
903 pr_debug("module %s: strtab %p, symhdr %p\n",
904 me->name, strtab, symhdr);
905
906 if(me->arch.got_count > MAX_GOTS) {
907 printk(KERN_ERR "%s: Global Offset Table overflow (used %ld, allowed
%d)\n",
908 me->name, me->arch.got_count, MAX_GOTS);
909 return -EINVAL;
910 }
911
912 kfree(me->arch.section);
913 me->arch.section = NULL;
914
915 /* no symbol table */
916 if(symhdr == NULL)
917 return 0;
918
919 oldptr = (void *)symhdr->sh_addr;
920 newptr = oldptr + 1; /* we start counting at 1 */
921 nsyms = symhdr->sh_size / sizeof(Elf_Sym);
922 pr_debug("OLD num_symtab %lu\n", nsyms);
923
924 for (i = 1; i < nsyms; i++) {
925 oldptr++; /* note, count starts at 1 so preincrement */
926 if(strncmp(strtab + oldptr->st_name,
927 ".L", 2) == 0)
928 continue;
929
930 if(newptr != oldptr)
931 *newptr++ = *oldptr;
932 else
933 newptr++;
934
935 }
936 nsyms = newptr - (Elf_Sym *)symhdr->sh_addr;
937 pr_debug("NEW num_symtab %lu\n", nsyms);
938 symhdr->sh_size = nsyms * sizeof(Elf_Sym);
939
940 /* find .altinstructions section */
941 secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
942 for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) {
943 void *aseg = (void *) s->sh_addr;
944 char *secname = secstrings + s->sh_name;
945
946 if (!strcmp(".altinstructions", secname))
947 /* patch .altinstructions */
948 apply_alternatives(aseg, aseg + s->sh_size, me->name);
949
950 /* For 32 bit kernels we're compiling modules with
951 * -ffunction-sections so we must relocate the addresses in the
952 * ftrace call site section.
953 */
954 if (symindex != -1 && !strcmp(secname,
FTRACE_CALLSITE_SECTION)) {
955 if (s->sh_type == SHT_REL)
956 err = apply_relocate((Elf_Shdr *)sechdrs,
957 strtab, symindex,
958 s - sechdrs, me);
959 else if (s->sh_type == SHT_RELA)
960 err = apply_relocate_add((Elf_Shdr *)sechdrs,
961 strtab, symindex,
962 s - sechdrs, me);
963 if (err)
964 return err;
965 }
966 }
967 return 0;
968 }
969
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation