[kvm-unit-tests PATCH 4/4] powerpc/ppc64: populate argv[0] with prognam

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
---
 lib/argv.c              | 4 ----
 powerpc/Makefile.common | 6 +++++-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/argv.c b/lib/argv.c
index 47ecb14c9f2d7..16e3c981736d6 100644
--- a/lib/argv.c
+++ b/lib/argv.c
@@ -42,10 +42,6 @@ void setup_args(char *args)
         for (int i = __argc; i > 0; --i)
             __argv[i] = __argv[i-1];
     }
-#if defined(__arm__) || defined(__aarch64__)
     __argv[0] = (char *)auxinfo.prognam;
-#else
-    __argv[0] = NULL; //HACK: just reserve argv[0] for now
-#endif
     ++__argc;
 }
diff --git a/powerpc/Makefile.common b/powerpc/Makefile.common
index 4449aec616853..150f5fc06bc2b 100644
--- a/powerpc/Makefile.common
+++ b/powerpc/Makefile.common
@@ -24,6 +24,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
@@ -38,9 +39,12 @@ FLATLIBS = $(libcflat) $(LIBFDT_archive)
 %.elf: CFLAGS += $(arch_CFLAGS)
 %.elf: LDFLAGS = $(arch_LDFLAGS) -nostdlib -pie
 %.elf: %.o $(FLATLIBS) powerpc/flat.lds
+	$(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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux