From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3C09EB64DA for ; Sat, 24 Jun 2023 10:32:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231966AbjFXKcH (ORCPT ); Sat, 24 Jun 2023 06:32:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231466AbjFXKcE (ORCPT ); Sat, 24 Jun 2023 06:32:04 -0400 Received: from out-52.mta0.migadu.com (out-52.mta0.migadu.com [IPv6:2001:41d0:1004:224b::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86AD826B0 for ; Sat, 24 Jun 2023 03:31:40 -0700 (PDT) Date: Sat, 24 Jun 2023 12:31:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1687602698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=n3n67zTOSkCuSmBIFx/64QtEed8ed1O/yKXJNvvKKX4=; b=bLvnzqWF6movDJFvurcUa+NXtzFw3w4by83NzUnJW7yzl/vUXwvzyOSx+Aj4B2xIrU5aTf FyeaMCle9mg2IzYPVwcatsNg8wKVdqpDqXiP08eFGmC7sKl8tY/5Yhvtaz5ZGZyjx/L/t7 q06no4SRykMkDoWy1TnruXGNByBzTXg= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Andrew Jones To: Nadav Amit Cc: kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Nikos Nikoleris , Nadav Amit Subject: Re: [kvm-unit-tests PATCH 1/6] arm: keep efi debug information in a separate file Message-ID: <20230624-774d9b995f86fca17f3d3d89@orel> References: <20230617014930.2070-1-namit@vmware.com> <20230617014930.2070-2-namit@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230617014930.2070-2-namit@vmware.com> X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Sat, Jun 17, 2023 at 01:49:25AM +0000, Nadav Amit wrote: > From: Nadav Amit > > Debugging tests that run on EFI is hard because the debug information is > not included in the EFI file. Dump it into a separeate .debug file to > allow the use of gdb or pretty_print_stacks script. > > Signed-off-by: Nadav Amit > --- > arm/Makefile.common | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/arm/Makefile.common b/arm/Makefile.common > index d60cf8c..f904702 100644 > --- a/arm/Makefile.common > +++ b/arm/Makefile.common > @@ -69,7 +69,7 @@ FLATLIBS = $(libcflat) $(LIBFDT_archive) $(libeabi) > ifeq ($(CONFIG_EFI),y) > %.so: EFI_LDFLAGS += -defsym=EFI_SUBSYSTEM=0xa --no-undefined > %.so: %.o $(FLATLIBS) $(SRCDIR)/arm/efi/elf_aarch64_efi.lds $(cstart.o) > - $(CC) $(CFLAGS) -c -o $(@:.so=.aux.o) $(SRCDIR)/lib/auxinfo.c \ > + $(CC) $(CFLAGS) -c -g -o $(@:.so=.aux.o) $(SRCDIR)/lib/auxinfo.c \ > -DPROGNAME=\"$(@:.so=.efi)\" -DAUXFLAGS=$(AUXFLAGS) > $(LD) $(EFI_LDFLAGS) -o $@ -T $(SRCDIR)/arm/efi/elf_aarch64_efi.lds \ > $(filter %.o, $^) $(FLATLIBS) $(@:.so=.aux.o) \ > @@ -78,6 +78,9 @@ ifeq ($(CONFIG_EFI),y) > > %.efi: %.so > $(call arch_elf_check, $^) > + $(OBJCOPY) --only-keep-debug $^ $@.debug > + $(OBJCOPY) --strip-debug $^ > + $(OBJCOPY) --add-gnu-debuglink=$@.debug $^ > $(OBJCOPY) \ > -j .text -j .sdata -j .data -j .dynamic -j .dynsym \ > -j .rel -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \ > -- > 2.34.1 > We also need a change to arm_clean to clean these new files up. Or, since we probably want them for x86 as well and we already have other efi cleanup to do, then maybe we should have a common efi_clean in the top- level Makefile which x86's and arm's clean use to clean up all efi related files. Thanks, drew