Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755865AbbKDL63 (ORCPT ); Wed, 4 Nov 2015 06:58:29 -0500 Received: from smtprelay.synopsys.com ([198.182.47.9]:43765 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754468AbbKDL62 (ORCPT ); Wed, 4 Nov 2015 06:58:28 -0500 Subject: Re: [PATCH] Arc: fix entry point calculation for locales other than english To: Lada Trimasova , References: <1446572099-2450-1-git-send-email-ltrimas@synopsys.com> CC: , Alexey Brodkin Newsgroups: gmane.linux.kernel,gmane.linux.kernel.arc From: Vineet Gupta Message-ID: <5639F26C.90007@synopsys.com> Date: Wed, 4 Nov 2015 17:26:28 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1446572099-2450-1-git-send-email-ltrimas@synopsys.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.12.197.182] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2063 Lines: 53 On Tuesday 03 November 2015 11:04 PM, Lada Trimasova wrote: > The problem was detected while making uImage. > To find the line with entry point address in the result > of the "readelf -h vmlinux" command "grep ENTRY POINT" is used. > > But if the operating system locale is not english, > command readelf returns lines in local language. > > Grep cannot find the line which contains "ENTRY POINT" in english. > Our decision uses readelf key which displays the symbol table. > Using grep _stext it finds the line with entry point in this table. > > Signed-off-by: Lada Trimasova > Cc: Vineet Gupta > Cc: Alexey Brodkin > --- > arch/arc/boot/Makefile | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/arch/arc/boot/Makefile b/arch/arc/boot/Makefile > index e597cb34..fa89a47 100644 > --- a/arch/arc/boot/Makefile > +++ b/arch/arc/boot/Makefile > @@ -6,8 +6,7 @@ targets := vmlinux.bin vmlinux.bin.gz uImage > > OBJCOPYFLAGS= -O binary -R .note -R .note.gnu.build-id -R .comment -S > > -LINUX_START_TEXT = $$(readelf -h vmlinux | \ > - grep "Entry point address" | grep -o 0x.*) > +LINUX_START_TEXT = $$(readelf -s vmlinux | grep _stext | awk '{print $$2}') This seems too fragile. You are assuming _stext will be the entry point which I recently changed and merged in Linux tree for 4.4-rc1. See commit 3971cdc202f638f252e39316d42492ace04cc1b1 "ARC: boot: Support Halt-on-reset and Run-on-reset SMP booting modes" And even if we change ur patch to use re_Service, it is still not future proof. We need to somehow rely on elf header for this ! I do see your problem but lets us see how other arches do it ! > > UIMAGE_LOADADDR = $(CONFIG_LINUX_LINK_BASE) > UIMAGE_ENTRYADDR = $(LINUX_START_TEXT) > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/