Fix up the whitespace irregularity in the ELF switch blocks. Swapping the initial value of gpfx allows us to simplify all but one of the one-line switch cases even further. Link: http://lkml.kernel.org/r/647f21f43723d3e831cedd3238c893db03eea6f0.1564596289.git.mhelsley@vmware.com
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -489,15 +489,15 @@ static int do_file(char const *const fname) · 488 unmodified lines | ||
| 489 | 489 | push_bl_mcount_thumb = push_bl_mcount_thumb_be; |
| 490 | 490 | break; |
| 491 | 491 | } /* end switch */ |
| 492 | − if (memcmp(ELFMAG, ehdr->e_ident, SELFMAG) != 0 | |
| 493 | − || w2(ehdr->e_type) != ET_REL | |
| 494 | − || ehdr->e_ident[EI_VERSION] != EV_CURRENT) { | |
| 492 | + if (memcmp(ELFMAG, ehdr->e_ident, SELFMAG) != 0 || | |
| 493 | + w2(ehdr->e_type) != ET_REL || | |
| 494 | + ehdr->e_ident[EI_VERSION] != EV_CURRENT) { | |
| 495 | 495 | fprintf(stderr, "unrecognized ET_REL file %s\n", fname); |
| 496 | 496 | cleanup(); |
| 497 | 497 | goto out; |
| 498 | 498 | } |
| 499 | 499 | |
| 500 | − gpfx = 0; | |
| 500 | + gpfx = '_'; | |
| 501 | 501 | switch (w2(ehdr->e_machine)) { |
| 502 | 502 | default: |
| 503 | 503 | fprintf(stderr, "unrecognized e_machine %u %s\n", |
| @@ -510,32 +510,35 @@ static int do_file(char const *const fname) · 6 unmodified lines | ||
| 510 | 510 | make_nop = make_nop_x86; |
| 511 | 511 | ideal_nop = ideal_nop5_x86_32; |
| 512 | 512 | mcount_adjust_32 = -1; |
| 513 | + gpfx = 0; | |
| 514 | + break; | |
| 515 | + case EM_ARM: | |
| 516 | + reltype = R_ARM_ABS32; | |
| 517 | + altmcount = "__gnu_mcount_nc"; | |
| 518 | + make_nop = make_nop_arm; | |
| 519 | + rel_type_nop = R_ARM_NONE; | |
| 520 | + gpfx = 0; | |
| 513 | 521 | break; |
| 514 | − case EM_ARM: reltype = R_ARM_ABS32; | |
| 515 | − altmcount = "__gnu_mcount_nc"; | |
| 516 | − make_nop = make_nop_arm; | |
| 517 | − rel_type_nop = R_ARM_NONE; | |
| 518 | − break; | |
| 519 | 522 | case EM_AARCH64: |
| 520 | − reltype = R_AARCH64_ABS64; | |
| 521 | − make_nop = make_nop_arm64; | |
| 522 | − rel_type_nop = R_AARCH64_NONE; | |
| 523 | − ideal_nop = ideal_nop4_arm64; | |
| 524 | − gpfx = '_'; | |
| 525 | − break; | |
| 526 | − case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break; | |
| 527 | − case EM_MIPS: /* reltype: e_class */ gpfx = '_'; break; | |
| 528 | − case EM_PPC: reltype = R_PPC_ADDR32; gpfx = '_'; break; | |
| 529 | − case EM_PPC64: reltype = R_PPC64_ADDR64; gpfx = '_'; break; | |
| 530 | − case EM_S390: /* reltype: e_class */ gpfx = '_'; break; | |
| 531 | − case EM_SH: reltype = R_SH_DIR32; break; | |
| 532 | − case EM_SPARCV9: reltype = R_SPARC_64; gpfx = '_'; break; | |
| 523 | + reltype = R_AARCH64_ABS64; | |
| 524 | + make_nop = make_nop_arm64; | |
| 525 | + rel_type_nop = R_AARCH64_NONE; | |
| 526 | + ideal_nop = ideal_nop4_arm64; | |
| 527 | + break; | |
| 528 | + case EM_IA_64: reltype = R_IA64_IMM64; break; | |
| 529 | + case EM_MIPS: /* reltype: e_class */ break; | |
| 530 | + case EM_PPC: reltype = R_PPC_ADDR32; break; | |
| 531 | + case EM_PPC64: reltype = R_PPC64_ADDR64; break; | |
| 532 | + case EM_S390: /* reltype: e_class */ break; | |
| 533 | + case EM_SH: reltype = R_SH_DIR32; gpfx = 0; break; | |
| 534 | + case EM_SPARCV9: reltype = R_SPARC_64; break; | |
| 533 | 535 | case EM_X86_64: |
| 534 | 536 | make_nop = make_nop_x86; |
| 535 | 537 | ideal_nop = ideal_nop5_x86_64; |
| 536 | 538 | reltype = R_X86_64_64; |
| 537 | 539 | rel_type_nop = R_X86_64_NONE; |
| 538 | 540 | mcount_adjust_64 = -1; |
| 541 | + gpfx = 0; | |
| 539 | 542 | break; |
| 540 | 543 | } /* end switch */ |
| 541 | 544 | |