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.

modpost: remove ElF_Rela variables from for-loop in section_rel(a)

Remove the Elf_Rela variables used in the for-loop in section_rel().

This makes the code consistent; section_rel() only uses Elf_Rel,
section_rela() only uses Elf_Rela.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+11 -14
+11 -14
scripts/mod/modpost.c
··· 1465 1465 Elf_Shdr *sechdr) 1466 1466 { 1467 1467 Elf_Rela *rela; 1468 - Elf_Rela r; 1469 - unsigned int r_sym; 1470 1468 unsigned int fsecndx = sechdr->sh_info; 1471 1469 const char *fromsec = sec_name(elf, fsecndx); 1472 1470 Elf_Rela *start = (void *)elf->hdr + sechdr->sh_offset; ··· 1475 1477 return; 1476 1478 1477 1479 for (rela = start; rela < stop; rela++) { 1478 - unsigned int r_type; 1480 + Elf_Addr taddr, r_offset; 1481 + unsigned int r_type, r_sym; 1479 1482 1480 - r.r_offset = TO_NATIVE(rela->r_offset); 1483 + r_offset = TO_NATIVE(rela->r_offset); 1481 1484 get_rel_type_and_sym(elf, rela->r_info, &r_type, &r_sym); 1482 1485 1483 - r.r_addend = TO_NATIVE(rela->r_addend); 1486 + taddr = TO_NATIVE(rela->r_addend); 1487 + 1484 1488 switch (elf->hdr->e_machine) { 1485 1489 case EM_RISCV: 1486 1490 if (!strcmp("__ex_table", fromsec) && ··· 1497 1497 } 1498 1498 1499 1499 check_section_mismatch(mod, elf, elf->symtab_start + r_sym, 1500 - fsecndx, fromsec, r.r_offset, r.r_addend); 1500 + fsecndx, fromsec, r_offset, taddr); 1501 1501 } 1502 1502 } 1503 1503 ··· 1505 1505 Elf_Shdr *sechdr) 1506 1506 { 1507 1507 Elf_Rel *rel; 1508 - Elf_Rela r; 1509 - unsigned int r_sym; 1510 1508 unsigned int fsecndx = sechdr->sh_info; 1511 1509 const char *fromsec = sec_name(elf, fsecndx); 1512 1510 Elf_Rel *start = (void *)elf->hdr + sechdr->sh_offset; ··· 1516 1518 1517 1519 for (rel = start; rel < stop; rel++) { 1518 1520 Elf_Sym *tsym; 1519 - Elf_Addr taddr = 0; 1521 + Elf_Addr taddr = 0, r_offset; 1522 + unsigned int r_type, r_sym; 1520 1523 void *loc; 1521 - unsigned int r_type; 1522 1524 1523 - r.r_offset = TO_NATIVE(rel->r_offset); 1524 - 1525 + r_offset = TO_NATIVE(rel->r_offset); 1525 1526 get_rel_type_and_sym(elf, rel->r_info, &r_type, &r_sym); 1526 1527 1527 - loc = sym_get_data_by_offset(elf, fsecndx, r.r_offset); 1528 + loc = sym_get_data_by_offset(elf, fsecndx, r_offset); 1528 1529 tsym = elf->symtab_start + r_sym; 1529 1530 1530 1531 switch (elf->hdr->e_machine) { ··· 1541 1544 } 1542 1545 1543 1546 check_section_mismatch(mod, elf, tsym, 1544 - fsecndx, fromsec, r.r_offset, taddr); 1547 + fsecndx, fromsec, r_offset, taddr); 1545 1548 } 1546 1549 } 1547 1550