* [peterz-queue:modules/core 1/5] kernel/module.c:2158:27: error: dereferencing pointer to incomplete type 'struct Elf64_Shdr'
@ 2019-10-22 4:57 kbuild test robot
0 siblings, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2019-10-22 4:57 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 4450 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git modules/core
head: 302719338a541af0e2d2ce9d0fec99e2dde09dae
commit: 220e0e0c6f6e0607d5effd71e0a67129405a3f7e [1/5] module,klp: Add module_section_{en,dis}able_*()
config: x86_64-rhel-7.6 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
git checkout 220e0e0c6f6e0607d5effd71e0a67129405a3f7e
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from arch/x86/include/asm/module.h:5:0,
from include/linux/module.h:27,
from include/linux/moduleloader.h:6,
from kernel/module.c:9:
include/asm-generic/module.h:16:18: warning: 'struct Elf64_Shdr' declared inside parameter list will not be visible outside of this definition or declaration
#define Elf_Shdr Elf64_Shdr
^
kernel/module.c:2156:35: note: in expansion of macro 'Elf_Shdr'
static void __frob_section(struct Elf_Shdr *sec, int (*set_memory)(unsigned long start, int num_pages))
^~~~~~~~
In file included from include/linux/export.h:44:0,
from kernel/module.c:7:
kernel/module.c: In function '__frob_section':
>> kernel/module.c:2158:27: error: dereferencing pointer to incomplete type 'struct Elf64_Shdr'
BUG_ON((unsigned long)sec->sh_addr & (PAGE_SIZE-1));
^
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
kernel/module.c:2158:2: note: in expansion of macro 'BUG_ON'
BUG_ON((unsigned long)sec->sh_addr & (PAGE_SIZE-1));
^~~~~~
kernel/module.c: In function 'frob_section':
>> kernel/module.c:2170:9: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
for (s = info->sechdrs; s < info->sechdrs + info->hdr.e_shnum; s++) {
^
kernel/module.c:2170:28: warning: comparison of distinct pointer types lacks a cast
for (s = info->sechdrs; s < info->sechdrs + info->hdr.e_shnum; s++) {
^
>> kernel/module.c:2170:66: error: increment of pointer to an incomplete type 'struct Elf64_Shdr'
for (s = info->sechdrs; s < info->sechdrs + info->hdr.e_shnum; s++) {
^~
kernel/module.c:2171:42: error: dereferencing pointer to incomplete type 'struct Elf64_Shdr'
secname = mod->klp_info->secstrings + s->sh_name;
^~
>> kernel/module.c:2175:18: error: passing argument 1 of '__frob_section' from incompatible pointer type [-Werror=incompatible-pointer-types]
__frob_section(s, set_memory);
^
kernel/module.c:2156:13: note: expected 'struct Elf64_Shdr *' but argument is of type 'struct Elf64_Shdr *'
static void __frob_section(struct Elf_Shdr *sec, int (*set_memory)(unsigned long start, int num_pages))
^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +2158 kernel/module.c
2155
> 2156 static void __frob_section(struct Elf_Shdr *sec, int (*set_memory)(unsigned long start, int num_pages))
2157 {
> 2158 BUG_ON((unsigned long)sec->sh_addr & (PAGE_SIZE-1));
2159 BUG_ON((unsigned long)sec->sh_size & (PAGE_SIZE-1));
2160 set_memory((unsigned long)sec->sh_addr, sec->sh_size >> PAGE_SHIFT);
2161 }
2162
2163 static void frob_section(struct module *mod, const char *section,
2164 int (*set_memory)(unsigned long start, int num_pages))
2165 {
2166 struct klp_modinfo *info = mod->klp_info;
2167 const char *secname;
2168 struct Elf_Shdr *s;
2169
> 2170 for (s = info->sechdrs; s < info->sechdrs + info->hdr.e_shnum; s++) {
2171 secname = mod->klp_info->secstrings + s->sh_name;
2172 if (strcmp(secname, section))
2173 continue;
2174
> 2175 __frob_section(s, set_memory);
2176 }
2177 }
2178
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 48305 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* [peterz-queue:modules/core 1/5] kernel/module.c:2158:27: error: dereferencing pointer to incomplete type 'struct Elf64_Shdr'
@ 2019-10-21 2:20 kbuild test robot
0 siblings, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2019-10-21 2:20 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3608 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git modules/core
head: acdb3b4c0fd4a3c6d3a7f5f0b411c5dda45f952b
commit: fe64802b6d0eaa1171826acc8f68d829f776d052 [1/5] module,klp: Add module_section_{en,dis}able_*()
config: x86_64-rhel-7.6 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
git checkout fe64802b6d0eaa1171826acc8f68d829f776d052
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from arch/x86/include/asm/module.h:5:0,
from include/linux/module.h:27,
from include/linux/moduleloader.h:6,
from kernel/module.c:9:
include/asm-generic/module.h:16:18: warning: 'struct Elf64_Shdr' declared inside parameter list will not be visible outside of this definition or declaration
#define Elf_Shdr Elf64_Shdr
^
kernel/module.c:2156:35: note: in expansion of macro 'Elf_Shdr'
static void __frob_section(struct Elf_Shdr *sec, int (*set_memory)(unsigned long start, int num_pages))
^~~~~~~~
In file included from include/linux/export.h:44:0,
from kernel/module.c:7:
kernel/module.c: In function '__frob_section':
>> kernel/module.c:2158:27: error: dereferencing pointer to incomplete type 'struct Elf64_Shdr'
BUG_ON((unsigned long)sec->sh_addr & (PAGE_SIZE-1));
^
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
kernel/module.c:2158:2: note: in expansion of macro 'BUG_ON'
BUG_ON((unsigned long)sec->sh_addr & (PAGE_SIZE-1));
^~~~~~
kernel/module.c: In function 'frob_section':
>> kernel/module.c:2175:18: error: passing argument 1 of '__frob_section' from incompatible pointer type [-Werror=incompatible-pointer-types]
__frob_section(s, set_memory);
^
kernel/module.c:2156:13: note: expected 'struct Elf64_Shdr *' but argument is of type 'Elf64_Shdr * {aka struct elf64_shdr *}'
static void __frob_section(struct Elf_Shdr *sec, int (*set_memory)(unsigned long start, int num_pages))
^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +2158 kernel/module.c
2155
> 2156 static void __frob_section(struct Elf_Shdr *sec, int (*set_memory)(unsigned long start, int num_pages))
2157 {
> 2158 BUG_ON((unsigned long)sec->sh_addr & (PAGE_SIZE-1));
2159 BUG_ON((unsigned long)sec->sh_size & (PAGE_SIZE-1));
2160 set_memory((unsigned long)sec->sh_addr, sec->sh_size >> PAGE_SHIFT);
2161 }
2162
2163 static void frob_section(struct module *mod, const char *section,
2164 int (*set_memory)(unsigned long start, int num_pages))
2165 {
2166 struct klp_modinfo *info = mod->klp_info;
2167 const char *secname;
2168 Elf_Shdr *s;
2169
2170 for (s = info->sechdrs; s < info->sechdrs + info->hdr.e_shnum; s++) {
2171 secname = mod->klp_info->secstrings + s->sh_name;
2172 if (strcmp(secname, section))
2173 continue;
2174
> 2175 __frob_section(s, set_memory);
2176 }
2177 }
2178
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 48310 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-22 4:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22 4:57 [peterz-queue:modules/core 1/5] kernel/module.c:2158:27: error: dereferencing pointer to incomplete type 'struct Elf64_Shdr' kbuild test robot
-- strict thread matches above, loose matches on Subject: below --
2019-10-21 2:20 kbuild test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.