diff mbox series

[kvm-unit-tests,v2] Makefiles: Remove the executable bit from the .elf and .flat files

Message ID 1532702645-30780-1-git-send-email-thuth@redhat.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests,v2] Makefiles: Remove the executable bit from the .elf and .flat files | expand

Commit Message

Thomas Huth July 27, 2018, 2:44 p.m. UTC
The .elf and .flat files are not runnable on the host operating system,
so they should not be marked as executable.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 v2:
 - Removed "rpm coloring" sentence from the patch description
 - Use "@" in front of the chmods

 arm/Makefile.common     | 2 ++
 powerpc/Makefile.common | 2 ++
 s390x/Makefile          | 1 +
 x86/Makefile.common     | 2 ++
 4 files changed, 7 insertions(+)

Comments

David Hildenbrand July 27, 2018, 2:50 p.m. UTC | #1
On 27.07.2018 16:44, Thomas Huth wrote:
> The .elf and .flat files are not runnable on the host operating system,
> so they should not be marked as executable.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  v2:
>  - Removed "rpm coloring" sentence from the patch description
>  - Use "@" in front of the chmods
> 
>  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..42da24c 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..ac3cab6 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..8ba2b92 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..e612dbe 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 \
> 

Reviewed-by: David Hildenbrand <david@redhat.com>
Laszlo Ersek July 27, 2018, 3:27 p.m. UTC | #2
On 07/27/18 16:44, Thomas Huth wrote:
> The .elf and .flat files are not runnable on the host operating system,
> so they should not be marked as executable.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  v2:
>  - Removed "rpm coloring" sentence from the patch description
>  - Use "@" in front of the chmods
> 
>  arm/Makefile.common     | 2 ++
>  powerpc/Makefile.common | 2 ++
>  s390x/Makefile          | 1 +
>  x86/Makefile.common     | 2 ++
>  4 files changed, 7 insertions(+)

Thank you for your patience :)

Acked-by: Laszlo Ersek <lersek@redhat.com>

Laszlo
Andrew Jones July 27, 2018, 4 p.m. UTC | #3
On Fri, Jul 27, 2018 at 04:44:05PM +0200, Thomas Huth wrote:
> The .elf and .flat files are not runnable on the host operating system,
> so they should not be marked as executable.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  v2:
>  - Removed "rpm coloring" sentence from the patch description
>  - Use "@" in front of the chmods
> 
>  arm/Makefile.common     | 2 ++
>  powerpc/Makefile.common | 2 ++
>  s390x/Makefile          | 1 +
>  x86/Makefile.common     | 2 ++
>  4 files changed, 7 insertions(+)
>

Thanks Thomas
 
Reviewed-by: Andrew Jones <drjones@redhat.com>
Paolo Bonzini Sept. 11, 2018, 2:01 p.m. UTC | #4
On 27/07/2018 16:44, Thomas Huth wrote:
> The .elf and .flat files are not runnable on the host operating system,
> so they should not be marked as executable.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  v2:
>  - Removed "rpm coloring" sentence from the patch description
>  - Use "@" in front of the chmods
> 
>  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..42da24c 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..ac3cab6 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..8ba2b92 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..e612dbe 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 \
> 

Queued, thanks.

Paolo
diff mbox series

Patch

diff --git a/arm/Makefile.common b/arm/Makefile.common
index 1cf9cdc..42da24c 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..ac3cab6 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..8ba2b92 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..e612dbe 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 \