From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23790 invoked by alias); 31 Oct 2012 13:41:21 -0000 Received: (qmail 23767 invoked by uid 22791); 31 Oct 2012 13:41:19 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 31 Oct 2012 13:41:13 +0000 Received: from eggs.gnu.org ([208.118.235.92]:34464) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1TTYXg-0002la-8v for gcc-help@gnu.org; Wed, 31 Oct 2012 09:41:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTYXZ-00080g-F9 for gcc-help@gnu.org; Wed, 31 Oct 2012 09:41:12 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:61183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTYXZ-000802-82 for gcc-help@gnu.org; Wed, 31 Oct 2012 09:41:05 -0400 Received: by mail-lb0-f169.google.com with SMTP id k6so1223992lbo.0 for ; Wed, 31 Oct 2012 06:41:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=Kdh3K81SMtUAwqVaCwbtsGQqCya60ekOH14XfIHarr0=; b=mvKEGi4EZrUpH5/H204mtMLset+UcMx/Qhd+QZV5d8MnqKVvOtg4pIp39p7xrYX13r iIr9vpLtj+JVzlEw4RVoiPuHhr+oNknRHa9Vu8jUdBqpxHzyQOVCEe53joZh1FrTby8N IApACvbFhLJuUeJxEn1IJAprNJAVJgVmAfj/WLSEcJ2EUFF07C9x0/Wpcu4OZevccm30 3cwFY2C8PIIOdD3vmN8ppMa6BV8Eb9/YXfYqb8SXhbobtRY6W7tz8RDQccqxRwijqhhJ CxspRY9ZfbMGo7BsIpkCZbhcnAhbRRZQU6c46FQIxYhodWp/P6zWNQ8n23kOD6gsFI2W Evcw== MIME-Version: 1.0 Received: by 10.152.122.11 with SMTP id lo11mr34015418lab.3.1351690863322; Wed, 31 Oct 2012 06:41:03 -0700 (PDT) Received: by 10.114.3.201 with HTTP; Wed, 31 Oct 2012 06:41:03 -0700 (PDT) In-Reply-To: References: Date: Wed, 31 Oct 2012 21:52:00 -0000 Message-ID: Subject: Re: How to identify Arch info when building From: Matthew Gretton-Dann To: naveen yadav Cc: gcc-help@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQm8YNh/jRAzD+cW9n+NDEQX+U26Z81H3bwJV6U/dL6C5fO3ncUlG0oNwh4L+KPh6/dkNESv X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.217.169 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg00180.txt.bz2 This is a linker issue, and best asked on binutils@sourceware.org. On 31 October 2012 12:58, naveen yadav 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