From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20553 invoked by alias); 24 Oct 2014 06:35:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 20543 invoked by uid 89); 24 Oct 2014 06:35:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qa0-f48.google.com Received: from mail-qa0-f48.google.com (HELO mail-qa0-f48.google.com) (209.85.216.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 24 Oct 2014 06:35:37 +0000 Received: by mail-qa0-f48.google.com with SMTP id x12so443062qac.35 for ; Thu, 23 Oct 2014 23:35:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=xoFSS5xhyTJODbUNXsu3E4JISrfjuEFNQaPwohcl5hM=; b=SmH1qZmIJLJSwPUq753iJj+9Dvsl2z8H6NCWv0wTEm+b+LlQSsuhxFJIKOKFpgYQts ak8nyGlDmlVPNFdbv3zJzUYdkU3aaSERXCxS3LWgXk8q3wMluOPpA98vGNi1fJL3akVg 2D8n7oVKfWRV9DMWWSaGkyoOTrdBmqjXe60SVfbCl6DmCpIkYNbcWIr8HRdUkUjKamXs Bx2RDcJIrU2mJd3oBti1PEBVOsrEiSJ+cFVcDnEjVOlHeFl+bTHz85Gw9PFDhHT/K/3k Or7CcNkYqKGIbXwI4STCadc5pw4TkPYBFihB9uItduOZ4WhcNV7Gxj1bRJLAoorS2lze FbwA== X-Gm-Message-State: ALoCoQnX6DpfmeSJZNtDVZJ3MPwTJ8jCEMivQWV8K0HS6jpRkqXpXFR7TTz1g+4wxnR3K80VJ8oO MIME-Version: 1.0 X-Received: by 10.170.51.208 with SMTP id 199mr3101960ykt.121.1414132534499; Thu, 23 Oct 2014 23:35:34 -0700 (PDT) Received: by 10.229.93.203 with HTTP; Thu, 23 Oct 2014 23:35:34 -0700 (PDT) In-Reply-To: <87siievw6z.fsf@codesourcery.com> References: <1413853021-4393-1-git-send-email-victor.kamensky@linaro.org> <1413853021-4393-6-git-send-email-victor.kamensky@linaro.org> <87siievw6z.fsf@codesourcery.com> Date: Fri, 24 Oct 2014 06:35:00 -0000 Message-ID: Subject: Re: [PATCH 5/5] ARM: asm-source.exp link options in case of armv7b target From: Victor Kamensky To: Yao Qi Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-10/txt/msg00626.txt.bz2 Hi Yao, On 23 October 2014 23:05, Yao Qi wrote: > Victor Kamensky writes: > >> + "armv7b-*-*" { >> + set asm-arch arm >> + append link-flags " -be8" >> + } > > We can't tell whether "-be8" is needed from the target triplet. > Considering multi-lib, "-be8" is needed for one multilib, but not > for the other. Any executable/library that runs on big endian V7 *must* be linked with -be8 option. Otherwise it simply won't run. In any other multilib option vfp, neon, etc -be8 must be set. Basically, in big endian case gcc/gas generates data and instructions in big endian format but ARM V7 requires that instruction should be little endian format. It is linker that does instructions byte swap. If -be8 flag is not passed during link while running on ARM V7 big endian target executable with crash with SIGILL. If link happens through gcc, then -be8 always passed for non relocatable code by compiler. In this particular case link happens directly with linker and -be8 is not default, so it is needed. One may argue that -be8 for final executables in ARM V7 BE target should be default even for linker, but it is not the current case ... Also note that you have plenty examples in the same test gdb/testsuite/gdb.asm/asm-source.exp that do very similar things. For example: "powerpc64le-*" { set asm-arch powerpc64le set asm-flags "-a64 -I${srcdir}/${subdir} $obj_include" append link-flags " -m elf64lppc" } Why "-m elf64lppc" is set for powerpc64le target? I suspect by very similar reasons. > Maybe, you can fix your problem by running tests via LDFLAGS_FOR_TARGET, > > $ make check RUNTESTFLAGS=3D'LDFLAGS_FOR_TARGET=3D-be8' > > or you can create your own board file foo.exp, and add > > set_board_info ldflags "-be8" I don't feel very strong about it, and definitely I can workaround this issue or just ignore the failure. It just seemed that it was very easy to fix. If you are still not convinced by above argument, yes, let's just drop it. Please let me know you final thoughts. We will proceed accordingly. I am fine either way. Thanks, Victor > $ make check RUNTESTFLAGS=3D'--target_board=3Dfoo' > > -- > Yao (=E9=BD=90=E5=B0=A7)