From: Andrew Jones Subject: [kvm-unit-tests REPOST PATCH v2 4/4] powerpc/ppc64: populate argv[0] with prognam Date: Sat, 4 Jun 2016 20:43:41 +0200 Message-ID: <1465065821-18391-5-git-send-email-drjones@redhat.com> References: <1465065821-18391-1-git-send-email-drjones@redhat.com> Cc: pbonzini@redhat.com, rkrcmar@redhat.com, lvivier@redhat.com, thuth@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36883 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbcFDSny (ORCPT ); Sat, 4 Jun 2016 14:43:54 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BBA1A20A89 for ; Sat, 4 Jun 2016 18:43:53 +0000 (UTC) In-Reply-To: <1465065821-18391-1-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Andrew Jones Reviewed-by: Thomas Huth --- lib/argv.c | 6 ------ powerpc/Makefile.common | 6 +++++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/argv.c b/lib/argv.c index 66cd43f24d336..63b9ab2af2d2a 100644 --- a/lib/argv.c +++ b/lib/argv.c @@ -38,9 +38,7 @@ void __setup_args(void) void setup_args(char *args) { -#if defined(__arm__) || defined(__aarch64__) const char *p; -#endif if (args) { __args = args; @@ -51,13 +49,9 @@ void setup_args(char *args) } else { copy_ptr = __args_copy; } -#if defined(__arm__) || defined(__aarch64__) __argv[0] = copy_ptr; p = auxinfo.prognam; while ((*copy_ptr++ = *p++) != 0) ; -#else - __argv[0] = NULL; //HACK: just reserve argv[0] for now -#endif ++__argc; } diff --git a/powerpc/Makefile.common b/powerpc/Makefile.common index 4ff1dc8f48d32..28101d7adc474 100644 --- a/powerpc/Makefile.common +++ b/powerpc/Makefile.common @@ -27,6 +27,7 @@ CFLAGS += -fpie asm-offsets = lib/$(ARCH)/asm-offsets.h include scripts/asm-offsets.mak +include scripts/auxinfo.mak cflatobjs += lib/util.o cflatobjs += lib/alloc.o @@ -41,9 +42,12 @@ FLATLIBS = $(libcflat) $(LIBFDT_archive) %.elf: CFLAGS += $(arch_CFLAGS) %.elf: LDFLAGS = $(arch_LDFLAGS) -nostdlib -pie %.elf: %.o $(FLATLIBS) powerpc/flat.lds $(cstart.o) $(reloc.o) + $(call gen-auxinfo,$(@:.elf=.aux.c),$@) + $(CC) $(CFLAGS) -c -o $(@:.elf=.aux.o) $(@:.elf=.aux.c) $(LD) $(LDFLAGS) -o $@ \ -T powerpc/flat.lds --build-id=none \ - $(filter %.o, $^) $(FLATLIBS) + $(filter %.o, $^) $(FLATLIBS) $(@:.elf=.aux.o) + $(RM) $(@:.elf=.aux).* @echo -n Checking $@ for unsupported reloc types... @if $(OBJDUMP) -R $@ | grep R_ | grep -v R_PPC64_RELATIVE; then \ false; \ -- 2.4.11