public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: naveen yadav <yad.naveen@gmail.com>
To: Matthew Gretton-Dann <matthew.gretton-dann@linaro.org>
Cc: gcc-help@gnu.org, binutils@sourceware.org
Subject: Re: How to identify Arch info when building
Date: Wed, 31 Oct 2012 22:06:00 -0000	[thread overview]
Message-ID: <CAJ8eaTxE2nmseBhRVeDHPBjxG2kS7Y3F2F6s+H0s3BKAcow-4w@mail.gmail.com> (raw)
In-Reply-To: <CADSXKXrMa8xoPrOc7GpTx2PNRfw+b3f0cYm+8VHVKKoVP+yUYg@mail.gmail.com>

Thanks Matthew for your suggestion,

the o/p is from linux-gnueabi-readelf -A .

and what you suggest is what we want. At link time we should get error
of mistmatch.

 >What you may be able to do (and I make no guarantees here) is add a
> stage to your build which checks the attributes on the generated .so
> after link to make sure that they match what you want.

so is there any way at link time I can verify that a particular .so or
.o is compile with different(ARM9), when build for A15.

Thanks


On Wed, Oct 31, 2012 at 7:11 PM, Matthew Gretton-Dann
<matthew.gretton-dann@linaro.org> wrote:
> This is a linker issue, and best asked on binutils@sourceware.org.
>
> On 31 October 2012 12:58, naveen yadav <yad.naveen@gmail.com> wrote:
>> Hi All,
>>
>> I have two ARM arch (A9 and A15). and have cross compiler for both.
>>
>> Since code is integrated, some time .so got mixed(A9 with A15), and at
>> run time it fails with undefined instruction.
>>
>> Is there any way to check strict at build time, we through an error.
>>
>> Scenario.
>>
>> (A15 code) + A9(.so)= executable when run on target (undefined instruction)
>>
>>  Tag_CPU_name: "Cortex-A15"
>>   Tag_CPU_arch: v7
>>   Tag_CPU_arch_profile: Application
>>   Tag_ARM_ISA_use: Yes
>>
>>
>>   Tag_CPU_name: "Cortex-A9"
>>   Tag_CPU_arch: v7
>>   Tag_CPU_arch_profile: Application
>
> It is unclear where the different attributes above are coming from.
>
> The linker's checking for incompatibilities between objects is
> restricted to examples like 'size of wchar_t == 2' is incompatible
> with 'size of wchar_t == 4'.  In this case it is obvious that these
> two objects will never work together.
>
> When it encounters two objects where one uses features that are not
> used in another (as for instance if you link objects for Cortex-A9
> which doesn't have integer-divide, and objects for Cortex-A15 which
> does) the linker assumes the user wants to run the code on the most
> 'feature'-ful.
>
> There is no way to tell the linker which CPU you intend to run the code on.
>
> What you may be able to do (and I make no guarantees here) is add a
> stage to your build which checks the attributes on the generated .so
> after link to make sure that they match what you want.
>
> Thanks,
>
> Matt
>
> --
> Matthew Gretton-Dann
> Linaro Toolchain Working Group
> matthew.gretton-dann@linaro.org

      reply	other threads:[~2012-10-31 13:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 13:41 naveen yadav
2012-10-31 21:52 ` Matthew Gretton-Dann
2012-10-31 22:06   ` naveen yadav [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ8eaTxE2nmseBhRVeDHPBjxG2kS7Y3F2F6s+H0s3BKAcow-4w@mail.gmail.com \
    --to=yad.naveen@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=gcc-help@gnu.org \
    --cc=matthew.gretton-dann@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).