arch/alpha/boot/stdio.c | 1 + arch/alpha/boot/tools/objstrip.c | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/arch/alpha/boot/stdio.c b/arch/alpha/boot/stdio.c index 60f73ccd2e89..2b91b86aafde 100644 --- a/arch/alpha/boot/stdio.c +++ b/arch/alpha/boot/stdio.c @@ -247,6 +247,7 @@ int vsprintf(char *buf, const char *fmt, va_list args) case 'X': flags |= LARGE; + fallthrough; case 'x': base = 16; break; diff --git a/arch/alpha/boot/tools/objstrip.c b/arch/alpha/boot/tools/objstrip.c index 08b430d25a31..1feb04af93b6 100644 --- a/arch/alpha/boot/tools/objstrip.c +++ b/arch/alpha/boot/tools/objstrip.c @@ -23,7 +23,6 @@ #include #include -#include #include #include #ifdef __ELF__ @@ -33,6 +32,11 @@ # define elf_check_arch(x) ((x)->e_machine == EM_ALPHA) #endif +/* Hack hack. We want the _alpha_ uapi/asm/a.out.h */ +#include "../../include/uapi/asm/a.out.h" +#define _ASM_X86_A_OUT_H +#include + /* bootfile size must be multiple of BLOCK_SIZE: */ #define BLOCK_SIZE 512 @@ -48,6 +52,11 @@ usage (void) exit(1); } +static __always_inline size_t str_has_prefix(const char *str, const char *prefix) +{ + size_t len = strlen(prefix); + return strncmp(str, prefix, len) == 0 ? len : 0; +} int main (int argc, char *argv[]) @@ -190,7 +199,7 @@ main (int argc, char *argv[]) if (verbose) { fprintf(stderr, "%s: extracting %#016lx-%#016lx (at %lx)\n", prog_name, (long) elf_phdr->p_vaddr, - elf_phdr->p_vaddr + fil_size, offset); + (long) elf_phdr->p_vaddr + fil_size, offset); } } else #endif @@ -220,8 +229,10 @@ main (int argc, char *argv[]) if (verbose) { fprintf(stderr, "%s: extracting %#016lx-%#016lx (at %lx)\n", - prog_name, aout->ah.text_start, - aout->ah.text_start + fil_size, offset); + prog_name, + (long)aout->ah.text_start, + (long)aout->ah.text_start + fil_size, + offset); } }