* [peterz-queue:x86/static_call 16/32] arch/s390/kernel/module.c:199:14: error: passing argument 2 of 'write' from incompatible pointer type
@ 2019-10-21 20:42 kbuild test robot
0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-10-21 20:42 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 25984 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/static_call
head: 8a62e7e4af05e50f74fdc398b042ffcab7eb2e90
commit: 162016785a82ce6b65c51482b4d266578dfa1d38 [16/32] livepatch: Use text_poke() for relocations
config: s390-allyesconfig (attached as .config)
compiler: s390-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 162016785a82ce6b65c51482b4d266578dfa1d38
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=s390
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
arch/s390/kernel/module.c: In function 'apply_rela_bits':
>> arch/s390/kernel/module.c:199:9: warning: passing argument 1 of 'write' makes pointer from integer without a cast [-Wint-conversion]
write(loc, &val, 1);
^~~
arch/s390/kernel/module.c:199:9: note: expected 'void *' but argument is of type 'Elf64_Addr {aka long long unsigned int}'
>> arch/s390/kernel/module.c:199:14: error: passing argument 2 of 'write' from incompatible pointer type [-Werror=incompatible-pointer-types]
write(loc, &val, 1);
^
arch/s390/kernel/module.c:199:14: note: expected 'const char *' but argument is of type 'Elf64_Addr * {aka long long unsigned int *}'
arch/s390/kernel/module.c:203:9: warning: passing argument 1 of 'write' makes pointer from integer without a cast [-Wint-conversion]
write(loc, &tmp, 2);
^~~
arch/s390/kernel/module.c:203:9: note: expected 'void *' but argument is of type 'Elf64_Addr {aka long long unsigned int}'
arch/s390/kernel/module.c:203:14: error: passing argument 2 of 'write' from incompatible pointer type [-Werror=incompatible-pointer-types]
write(loc, &tmp, 2);
^
arch/s390/kernel/module.c:203:14: note: expected 'const char *' but argument is of type 'short unsigned int *'
arch/s390/kernel/module.c:205:9: warning: passing argument 1 of 'write' makes pointer from integer without a cast [-Wint-conversion]
write(loc, &val, 2);
^~~
arch/s390/kernel/module.c:205:9: note: expected 'void *' but argument is of type 'Elf64_Addr {aka long long unsigned int}'
arch/s390/kernel/module.c:205:14: error: passing argument 2 of 'write' from incompatible pointer type [-Werror=incompatible-pointer-types]
write(loc, &val, 2);
^
arch/s390/kernel/module.c:205:14: note: expected 'const char *' but argument is of type 'Elf64_Addr * {aka long long unsigned int *}'
arch/s390/kernel/module.c:209:9: warning: passing argument 1 of 'write' makes pointer from integer without a cast [-Wint-conversion]
write(loc, &tmp, 4);
^~~
arch/s390/kernel/module.c:209:9: note: expected 'void *' but argument is of type 'Elf64_Addr {aka long long unsigned int}'
arch/s390/kernel/module.c:209:14: error: passing argument 2 of 'write' from incompatible pointer type [-Werror=incompatible-pointer-types]
write(loc, &tmp, 4);
^
arch/s390/kernel/module.c:209:14: note: expected 'const char *' but argument is of type 'unsigned int *'
arch/s390/kernel/module.c:211:9: warning: passing argument 1 of 'write' makes pointer from integer without a cast [-Wint-conversion]
write(loc, &val, 4);
^~~
arch/s390/kernel/module.c:211:9: note: expected 'void *' but argument is of type 'Elf64_Addr {aka long long unsigned int}'
arch/s390/kernel/module.c:211:14: error: passing argument 2 of 'write' from incompatible pointer type [-Werror=incompatible-pointer-types]
write(loc, &val, 4);
^
arch/s390/kernel/module.c:211:14: note: expected 'const char *' but argument is of type 'Elf64_Addr * {aka long long unsigned int *}'
arch/s390/kernel/module.c:213:9: warning: passing argument 1 of 'write' makes pointer from integer without a cast [-Wint-conversion]
write(loc, &val, 8);
^~~
arch/s390/kernel/module.c:213:9: note: expected 'void *' but argument is of type 'Elf64_Addr {aka long long unsigned int}'
arch/s390/kernel/module.c:213:14: error: passing argument 2 of 'write' from incompatible pointer type [-Werror=incompatible-pointer-types]
write(loc, &val, 8);
^
arch/s390/kernel/module.c:213:14: note: expected 'const char *' but argument is of type 'Elf64_Addr * {aka long long unsigned int *}'
arch/s390/kernel/module.c: In function 'apply_rela':
>> arch/s390/kernel/module.c:248:44: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 0, 8, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:250:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 0, 12, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:252:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 0, 16, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:254:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 1, 20, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:256:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 0, 32, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:258:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 0, 64, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:267:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 1, 16, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:269:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 1, 16, 1, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:271:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 1, 32, 1, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:273:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 1, 32, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:275:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 1, 64, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:300:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 0, 12, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:303:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 0, 16, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:306:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 1, 20, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:309:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 0, 32, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:312:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 0, 64, 0, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
^~~~~~~~~~~~~~~
arch/s390/kernel/module.c:316:45: error: passing argument 6 of 'apply_rela_bits' from incompatible pointer type [-Werror=incompatible-pointer-types]
rc = apply_rela_bits(loc, val, 1, 32, 1, write);
^~~~~
arch/s390/kernel/module.c:176:12: note: expected 'void (*)(void *, const char *, size_t) {aka void (*)(void *, const char *, long unsigned int)}' but argument is of type 'void (*)(void *, const void *, size_t) {aka void (*)(void *, const void *, long unsigned int)}'
static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
vim +/write +199 arch/s390/kernel/module.c
175
176 static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
177 int sign, int bits, int shift,
178 void (*write)(void *addr, const char *data, size_t len))
179 {
180 unsigned long umax;
181 long min, max;
182
183 if (val & ((1UL << shift) - 1))
184 return -ENOEXEC;
185 if (sign) {
186 val = (Elf_Addr)(((long) val) >> shift);
187 min = -(1L << (bits - 1));
188 max = (1L << (bits - 1)) - 1;
189 if ((long) val < min || (long) val > max)
190 return -ENOEXEC;
191 } else {
192 val >>= shift;
193 umax = ((1UL << (bits - 1)) << 1) - 1;
194 if ((unsigned long) val > umax)
195 return -ENOEXEC;
196 }
197
198 if (bits == 8) {
> 199 write(loc, &val, 1);
200 } else if (bits == 12) {
201 unsigned short tmp = (val & 0xfff) |
202 (*(unsigned short *) loc & 0xf000);
203 write(loc, &tmp, 2);
204 } else if (bits == 16) {
205 write(loc, &val, 2);
206 } else if (bits == 20) {
207 unsigned int tmp = (val & 0xfff) << 16 |
208 (val & 0xff000) >> 4 | (*(unsigned int *) loc & 0xf00000ff);
209 write(loc, &tmp, 4);
210 } else if (bits == 32) {
211 write(loc, &val, 4);
212 } else if (bits == 64) {
> 213 write(loc, &val, 8);
214 }
215 return 0;
216 }
217
218 static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
219 const char *strtab, struct module *me,
220 void (*write)(void *addr, const void *data, size_t len))
221 {
222 struct mod_arch_syminfo *info;
223 Elf_Addr loc, val;
224 int r_type, r_sym;
225 int rc = -ENOEXEC;
226
227 /* This is where to make the change */
228 loc = base + rela->r_offset;
229 /* This is the symbol it is referring to. Note that all
230 undefined symbols have been resolved. */
231 r_sym = ELF_R_SYM(rela->r_info);
232 r_type = ELF_R_TYPE(rela->r_info);
233 info = me->arch.syminfo + r_sym;
234 val = symtab[r_sym].st_value;
235
236 switch (r_type) {
237 case R_390_NONE: /* No relocation. */
238 rc = 0;
239 break;
240 case R_390_8: /* Direct 8 bit. */
241 case R_390_12: /* Direct 12 bit. */
242 case R_390_16: /* Direct 16 bit. */
243 case R_390_20: /* Direct 20 bit. */
244 case R_390_32: /* Direct 32 bit. */
245 case R_390_64: /* Direct 64 bit. */
246 val += rela->r_addend;
247 if (r_type == R_390_8)
> 248 rc = apply_rela_bits(loc, val, 0, 8, 0, write);
249 else if (r_type == R_390_12)
250 rc = apply_rela_bits(loc, val, 0, 12, 0, write);
251 else if (r_type == R_390_16)
252 rc = apply_rela_bits(loc, val, 0, 16, 0, write);
253 else if (r_type == R_390_20)
254 rc = apply_rela_bits(loc, val, 1, 20, 0, write);
255 else if (r_type == R_390_32)
256 rc = apply_rela_bits(loc, val, 0, 32, 0, write);
257 else if (r_type == R_390_64)
258 rc = apply_rela_bits(loc, val, 0, 64, 0, write);
259 break;
260 case R_390_PC16: /* PC relative 16 bit. */
261 case R_390_PC16DBL: /* PC relative 16 bit shifted by 1. */
262 case R_390_PC32DBL: /* PC relative 32 bit shifted by 1. */
263 case R_390_PC32: /* PC relative 32 bit. */
264 case R_390_PC64: /* PC relative 64 bit. */
265 val += rela->r_addend - loc;
266 if (r_type == R_390_PC16)
267 rc = apply_rela_bits(loc, val, 1, 16, 0, write);
268 else if (r_type == R_390_PC16DBL)
269 rc = apply_rela_bits(loc, val, 1, 16, 1, write);
270 else if (r_type == R_390_PC32DBL)
271 rc = apply_rela_bits(loc, val, 1, 32, 1, write);
272 else if (r_type == R_390_PC32)
273 rc = apply_rela_bits(loc, val, 1, 32, 0, write);
274 else if (r_type == R_390_PC64)
275 rc = apply_rela_bits(loc, val, 1, 64, 0, write);
276 break;
277 case R_390_GOT12: /* 12 bit GOT offset. */
278 case R_390_GOT16: /* 16 bit GOT offset. */
279 case R_390_GOT20: /* 20 bit GOT offset. */
280 case R_390_GOT32: /* 32 bit GOT offset. */
281 case R_390_GOT64: /* 64 bit GOT offset. */
282 case R_390_GOTENT: /* 32 bit PC rel. to GOT entry shifted by 1. */
283 case R_390_GOTPLT12: /* 12 bit offset to jump slot. */
284 case R_390_GOTPLT20: /* 20 bit offset to jump slot. */
285 case R_390_GOTPLT16: /* 16 bit offset to jump slot. */
286 case R_390_GOTPLT32: /* 32 bit offset to jump slot. */
287 case R_390_GOTPLT64: /* 64 bit offset to jump slot. */
288 case R_390_GOTPLTENT: /* 32 bit rel. offset to jump slot >> 1. */
289 if (info->got_initialized == 0) {
290 Elf_Addr *gotent;
291
292 gotent = me->core_layout.base + me->arch.got_offset +
293 info->got_offset;
294 *gotent = val;
295 info->got_initialized = 1;
296 }
297 val = info->got_offset + rela->r_addend;
298 if (r_type == R_390_GOT12 ||
299 r_type == R_390_GOTPLT12)
300 rc = apply_rela_bits(loc, val, 0, 12, 0, write);
301 else if (r_type == R_390_GOT16 ||
302 r_type == R_390_GOTPLT16)
303 rc = apply_rela_bits(loc, val, 0, 16, 0, write);
304 else if (r_type == R_390_GOT20 ||
305 r_type == R_390_GOTPLT20)
306 rc = apply_rela_bits(loc, val, 1, 20, 0, write);
307 else if (r_type == R_390_GOT32 ||
308 r_type == R_390_GOTPLT32)
309 rc = apply_rela_bits(loc, val, 0, 32, 0, write);
310 else if (r_type == R_390_GOT64 ||
311 r_type == R_390_GOTPLT64)
312 rc = apply_rela_bits(loc, val, 0, 64, 0, write);
313 else if (r_type == R_390_GOTENT ||
314 r_type == R_390_GOTPLTENT) {
315 val += (Elf_Addr) me->core_layout.base - loc;
316 rc = apply_rela_bits(loc, val, 1, 32, 1, write);
317 }
318 break;
319 case R_390_PLT16DBL: /* 16 bit PC rel. PLT shifted by 1. */
320 case R_390_PLT32DBL: /* 32 bit PC rel. PLT shifted by 1. */
321 case R_390_PLT32: /* 32 bit PC relative PLT address. */
322 case R_390_PLT64: /* 64 bit PC relative PLT address. */
323 case R_390_PLTOFF16: /* 16 bit offset from GOT to PLT. */
324 case R_390_PLTOFF32: /* 32 bit offset from GOT to PLT. */
325 case R_390_PLTOFF64: /* 16 bit offset from GOT to PLT. */
326 if (info->plt_initialized == 0) {
327 unsigned int *ip;
328 ip = me->core_layout.base + me->arch.plt_offset +
329 info->plt_offset;
330 ip[0] = 0x0d10e310; /* basr 1,0 */
331 ip[1] = 0x100a0004; /* lg 1,10(1) */
332 if (IS_ENABLED(CONFIG_EXPOLINE) && !nospec_disable) {
333 unsigned int *ij;
334 ij = me->core_layout.base +
335 me->arch.plt_offset +
336 me->arch.plt_size - PLT_ENTRY_SIZE;
337 ip[2] = 0xa7f40000 + /* j __jump_r1 */
338 (unsigned int)(u16)
339 (((unsigned long) ij - 8 -
340 (unsigned long) ip) / 2);
341 } else {
342 ip[2] = 0x07f10000; /* br %r1 */
343 }
344 ip[3] = (unsigned int) (val >> 32);
345 ip[4] = (unsigned int) val;
346 info->plt_initialized = 1;
347 }
348 if (r_type == R_390_PLTOFF16 ||
349 r_type == R_390_PLTOFF32 ||
350 r_type == R_390_PLTOFF64)
351 val = me->arch.plt_offset - me->arch.got_offset +
352 info->plt_offset + rela->r_addend;
353 else {
354 if (!((r_type == R_390_PLT16DBL &&
355 val - loc + 0xffffUL < 0x1ffffeUL) ||
356 (r_type == R_390_PLT32DBL &&
357 val - loc + 0xffffffffULL < 0x1fffffffeULL)))
358 val = (Elf_Addr) me->core_layout.base +
359 me->arch.plt_offset +
360 info->plt_offset;
361 val += rela->r_addend - loc;
362 }
363 if (r_type == R_390_PLT16DBL)
364 rc = apply_rela_bits(loc, val, 1, 16, 1, write);
365 else if (r_type == R_390_PLTOFF16)
366 rc = apply_rela_bits(loc, val, 0, 16, 0, write);
367 else if (r_type == R_390_PLT32DBL)
368 rc = apply_rela_bits(loc, val, 1, 32, 1, write);
369 else if (r_type == R_390_PLT32 ||
370 r_type == R_390_PLTOFF32)
371 rc = apply_rela_bits(loc, val, 0, 32, 0, write);
372 else if (r_type == R_390_PLT64 ||
373 r_type == R_390_PLTOFF64)
374 rc = apply_rela_bits(loc, val, 0, 64, 0, write);
375 break;
376 case R_390_GOTOFF16: /* 16 bit offset to GOT. */
377 case R_390_GOTOFF32: /* 32 bit offset to GOT. */
378 case R_390_GOTOFF64: /* 64 bit offset to GOT. */
379 val = val + rela->r_addend -
380 ((Elf_Addr) me->core_layout.base + me->arch.got_offset);
381 if (r_type == R_390_GOTOFF16)
382 rc = apply_rela_bits(loc, val, 0, 16, 0, write);
383 else if (r_type == R_390_GOTOFF32)
384 rc = apply_rela_bits(loc, val, 0, 32, 0, write);
385 else if (r_type == R_390_GOTOFF64)
386 rc = apply_rela_bits(loc, val, 0, 64, 0, write);
387 break;
388 case R_390_GOTPC: /* 32 bit PC relative offset to GOT. */
389 case R_390_GOTPCDBL: /* 32 bit PC rel. off. to GOT shifted by 1. */
390 val = (Elf_Addr) me->core_layout.base + me->arch.got_offset +
391 rela->r_addend - loc;
392 if (r_type == R_390_GOTPC)
393 rc = apply_rela_bits(loc, val, 1, 32, 0, write);
394 else if (r_type == R_390_GOTPCDBL)
395 rc = apply_rela_bits(loc, val, 1, 32, 1, write);
396 break;
397 case R_390_COPY:
398 case R_390_GLOB_DAT: /* Create GOT entry. */
399 case R_390_JMP_SLOT: /* Create PLT entry. */
400 case R_390_RELATIVE: /* Adjust by program base. */
401 /* Only needed if we want to support loading of
402 modules linked with -shared. */
403 return -ENOEXEC;
404 default:
405 printk(KERN_ERR "module %s: unknown relocation: %u\n",
406 me->name, r_type);
407 return -ENOEXEC;
408 }
409 if (rc) {
410 printk(KERN_ERR "module %s: relocation error for symbol %s "
411 "(r_type %i, value 0x%lx)\n",
412 me->name, strtab + symtab[r_sym].st_name,
413 r_type, (unsigned long) val);
414 return rc;
415 }
416 return 0;
417 }
418
---
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: 56509 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-10-21 20:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21 20:42 [peterz-queue:x86/static_call 16/32] arch/s390/kernel/module.c:199:14: error: passing argument 2 of 'write' from incompatible pointer type 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.