From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24657 invoked by alias); 24 Oct 2014 06:38:39 -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 24646 invoked by uid 89); 24 Oct 2014 06:38:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f173.google.com Received: from mail-lb0-f173.google.com (HELO mail-lb0-f173.google.com) (209.85.217.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 24 Oct 2014 06:38:38 +0000 Received: by mail-lb0-f173.google.com with SMTP id 10so2035778lbg.32 for ; Thu, 23 Oct 2014 23:38:33 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.152.243.39 with SMTP id wv7mr2255398lac.48.1414132713360; Thu, 23 Oct 2014 23:38:33 -0700 (PDT) Received: by 10.25.213.80 with HTTP; Thu, 23 Oct 2014 23:38:33 -0700 (PDT) In-Reply-To: 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:38:00 -0000 Message-ID: Subject: Re: [PATCH 5/5] ARM: asm-source.exp link options in case of armv7b target From: Andrew Pinski To: Victor Kamensky Cc: Yao Qi , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00627.txt.bz2 On Thu, Oct 23, 2014 at 11:35 PM, Victor Kamensky wrote: > 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. Yes and no. For PowerPC64 little-endian is Linux only so it will never have a multi-libs that support both little-endian and big-endian. While for arm*-*-*, you can have a bare metal env and that could have a multi-lib for both little and big endian. This is true for MIPS too. Thanks, Andrew Pinski > >> 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)