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 | push_bl_mcount_thumb = push_bl_mcount_thumb_be; | 489 | push_bl_mcount_thumb = push_bl_mcount_thumb_be; |
| 490 | break; | 490 | break; |
| 491 | } /* end switch */ | 491 | } /* end switch */ |
| 492 | if (memcmp(ELFMAG, ehdr->e_ident, SELFMAG) != 0 | 492 | if (memcmp(ELFMAG, ehdr->e_ident, SELFMAG) != 0 || |
| 493 | || w2(ehdr->e_type) != ET_REL | 493 | w2(ehdr->e_type) != ET_REL || |
| 494 | || ehdr->e_ident[EI_VERSION] != EV_CURRENT) { | 494 | ehdr->e_ident[EI_VERSION] != EV_CURRENT) { |
| 495 | fprintf(stderr, "unrecognized ET_REL file %s\n", fname); | 495 | fprintf(stderr, "unrecognized ET_REL file %s\n", fname); |
| 496 | cleanup(); | 496 | cleanup(); |
| 497 | goto out; | 497 | goto out; |
| 498 | } | 498 | } |
| 499 | 499 | ||
| 500 | gpfx = 0; | 500 | gpfx = '_'; |
| 501 | switch (w2(ehdr->e_machine)) { | 501 | switch (w2(ehdr->e_machine)) { |
| 502 | default: | 502 | default: |
| 503 | fprintf(stderr, "unrecognized e_machine %u %s\n", | 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 | make_nop = make_nop_x86; | 510 | make_nop = make_nop_x86; |
| 511 | ideal_nop = ideal_nop5_x86_32; | 511 | ideal_nop = ideal_nop5_x86_32; |
| 512 | mcount_adjust_32 = -1; | 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 | break; | 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 | case EM_AARCH64: | 522 | case EM_AARCH64: |
| 520 | reltype = R_AARCH64_ABS64; | 523 | reltype = R_AARCH64_ABS64; |
| 521 | make_nop = make_nop_arm64; | 524 | make_nop = make_nop_arm64; |
| 522 | rel_type_nop = R_AARCH64_NONE; | 525 | rel_type_nop = R_AARCH64_NONE; |
| 523 | ideal_nop = ideal_nop4_arm64; | 526 | ideal_nop = ideal_nop4_arm64; |
| 524 | gpfx = '_'; | 527 | break; |
| 525 | break; | 528 | case EM_IA_64: reltype = R_IA64_IMM64; break; |
| 526 | case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break; | 529 | case EM_MIPS: /* reltype: e_class */ break; |
| 527 | case EM_MIPS: /* reltype: e_class */ gpfx = '_'; break; | 530 | case EM_PPC: reltype = R_PPC_ADDR32; break; |
| 528 | case EM_PPC: reltype = R_PPC_ADDR32; gpfx = '_'; break; | 531 | case EM_PPC64: reltype = R_PPC64_ADDR64; break; |
| 529 | case EM_PPC64: reltype = R_PPC64_ADDR64; gpfx = '_'; break; | 532 | case EM_S390: /* reltype: e_class */ break; |
| 530 | case EM_S390: /* reltype: e_class */ gpfx = '_'; break; | 533 | case EM_SH: reltype = R_SH_DIR32; gpfx = 0; break; |
| 531 | case EM_SH: reltype = R_SH_DIR32; break; | 534 | case EM_SPARCV9: reltype = R_SPARC_64; break; |
| 532 | case EM_SPARCV9: reltype = R_SPARC_64; gpfx = '_'; break; | ||
| 533 | case EM_X86_64: | 535 | case EM_X86_64: |
| 534 | make_nop = make_nop_x86; | 536 | make_nop = make_nop_x86; |
| 535 | ideal_nop = ideal_nop5_x86_64; | 537 | ideal_nop = ideal_nop5_x86_64; |
| 536 | reltype = R_X86_64_64; | 538 | reltype = R_X86_64_64; |
| 537 | rel_type_nop = R_X86_64_NONE; | 539 | rel_type_nop = R_X86_64_NONE; |
| 538 | mcount_adjust_64 = -1; | 540 | mcount_adjust_64 = -1; |
| 541 | gpfx = 0; | ||
| 539 | break; | 542 | break; |
| 540 | } /* end switch */ | 543 | } /* end switch */ |
| 541 | 544 | ||