From patchwork Thu Jul 26 08:21:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10545415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC173112E for ; Thu, 26 Jul 2018 08:21:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD4162AE5D for ; Thu, 26 Jul 2018 08:21:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0D1E2AE60; Thu, 26 Jul 2018 08:21:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E04F2AE5D for ; Thu, 26 Jul 2018 08:21:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728946AbeGZJhi (ORCPT ); Thu, 26 Jul 2018 05:37:38 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46834 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728378AbeGZJhi (ORCPT ); Thu, 26 Jul 2018 05:37:38 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 946FB40216E7 for ; Thu, 26 Jul 2018 08:21:54 +0000 (UTC) Received: from thh440s.str.redhat.com (dhcp-200-180.str.redhat.com [10.33.200.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A87B2026D68; Thu, 26 Jul 2018 08:21:53 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?b?UmFk?= =?utf-8?b?aW0gS3LEjW3DocWZ?= Cc: Drew Jones , Laurent Vivier , David Hildenbrand , Laszlo Ersek Subject: [kvm-unit-tests PATCH] Makefiles: Remove the executable bit from the .elf and .flat files Date: Thu, 26 Jul 2018 10:21:52 +0200 Message-Id: <1532593312-19640-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 26 Jul 2018 08:21:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 26 Jul 2018 08:21:54 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The .elf and .flat files are not runnable on the host operating system, so they should not be marked as executable. As we discovered recently, the executable flag can also cause trouble when the files are packaged in an .rpm file, since rpm "colors" the package differently if there are 32-bit or 64-bit executables in the package (for multilib support). Suggested-by: Laszlo Ersek Signed-off-by: Thomas Huth Reviewed-by: Paolo Bonzini Reviewed-by: David Hildenbrand Acked-by: Laszlo Ersek --- arm/Makefile.common | 2 ++ powerpc/Makefile.common | 2 ++ s390x/Makefile | 1 + x86/Makefile.common | 2 ++ 4 files changed, 7 insertions(+) diff --git a/arm/Makefile.common b/arm/Makefile.common index 1cf9cdc..e62a978 100644 --- a/arm/Makefile.common +++ b/arm/Makefile.common @@ -73,9 +73,11 @@ FLATLIBS = $(libcflat) $(LIBFDT_archive) $(libgcc) $(libeabi) -Wl,-T,$(SRCDIR)/arm/flat.lds,--build-id=none,-Ttext=$(start_addr) \ $(filter %.o, $^) $(FLATLIBS) \ $(SRCDIR)/lib/auxinfo.c -DPROGNAME=\"$(@:.elf=.flat)\" -DAUXFLAGS=$(AUXFLAGS) + chmod a-x $@ %.flat: %.elf $(OBJCOPY) -O binary $^ $@ + chmod a-x $@ $(libeabi): $(eabiobjs) $(AR) rcs $@ $^ diff --git a/powerpc/Makefile.common b/powerpc/Makefile.common index 81c5074..af6b9d8 100644 --- a/powerpc/Makefile.common +++ b/powerpc/Makefile.common @@ -54,6 +54,7 @@ FLATLIBS = $(libcflat) $(LIBFDT_archive) -T $(SRCDIR)/powerpc/flat.lds --build-id=none \ $(filter %.o, $^) $(FLATLIBS) $(@:.elf=.aux.o) $(RM) $(@:.elf=.aux.o) + chmod a-x $@ @echo -n Checking $@ for unsupported reloc types... @if $(OBJDUMP) -R $@ | grep R_ | grep -v R_PPC64_RELATIVE; then \ false; \ @@ -70,6 +71,7 @@ $(TEST_DIR)/boot_rom.bin: $(TEST_DIR)/boot_rom.elf $(TEST_DIR)/boot_rom.elf: CFLAGS = -mbig-endian $(TEST_DIR)/boot_rom.elf: $(TEST_DIR)/boot_rom.o $(LD) -EB -nostdlib -Ttext=0x100 --entry=start --build-id=none -o $@ $< + chmod a-x $@ powerpc_clean: libfdt_clean asm_offsets_clean $(RM) $(TEST_DIR)/*.{o,elf} $(TEST_DIR)/boot_rom.bin \ diff --git a/s390x/Makefile b/s390x/Makefile index 6546a02..6b32f2c 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -53,6 +53,7 @@ FLATLIBS = $(libcflat) $(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/flat.lds -Ttext=0x10000 \ $(filter %.o, $^) $(FLATLIBS) $(@:.elf=.aux.o) $(RM) $(@:.elf=.aux.o) + chmod a-x $@ arch_clean: asm_offsets_clean $(RM) $(TEST_DIR)/*.{o,elf} $(TEST_DIR)/.*.d lib/s390x/.*.d diff --git a/x86/Makefile.common b/x86/Makefile.common index 7dcf8c2..0d64284 100644 --- a/x86/Makefile.common +++ b/x86/Makefile.common @@ -42,9 +42,11 @@ FLATLIBS = lib/libcflat.a $(libgcc) %.elf: %.o $(FLATLIBS) $(SRCDIR)/x86/flat.lds $(cstart.o) $(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,$(SRCDIR)/x86/flat.lds \ $(filter %.o, $^) $(FLATLIBS) + chmod a-x $@ %.flat: %.elf $(OBJCOPY) -O elf32-i386 $^ $@ + chmod a-x $@ tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \ $(TEST_DIR)/smptest.flat $(TEST_DIR)/port80.flat \