Merge "Fix false positive when checking ELF prebuilts in PRODUCT_COPY_FILES" into main am: b1e947f8a1

Original change: https://android-review.googlesource.com/c/platform/build/+/3467164

Change-Id: I638d064e366bd27144c9e52c4899d5dbf1aecd30
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/core/definitions.mk b/core/definitions.mk
index 1ab6388..ade8a9c 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -3286,7 +3286,7 @@
 	$(hide) mkdir -p "$$(dir $$@)"
 	$(hide) rm -f "$$@"
 	$(hide) \
-	    if $(LLVM_READOBJ) -h "$$<" >/dev/null 2>&1; then \
+	    if $(LLVM_READOBJ) -h "$$<" 2>/dev/null | grep -q "^Format: elf"; then \
 	        $(call echo-error,$(2),$(3)); \
 	        $(call echo-error,$(2),found ELF file: $$<); \
 	        false; \