From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29482 invoked by alias); 2 Sep 2014 10:45:46 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 29423 invoked by uid 89); 2 Sep 2014 10:45:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mailout3.w1.samsung.com Received: from mailout3.w1.samsung.com (HELO mailout3.w1.samsung.com) (210.118.77.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (DES-CBC3-SHA encrypted) ESMTPS; Tue, 02 Sep 2014 10:45:43 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NB9009R2SOTTH20@mailout3.w1.samsung.com> for binutils@sourceware.org; Tue, 02 Sep 2014 11:48:29 +0100 (BST) Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id BE.01.25543.2DF95045; Tue, 02 Sep 2014 11:45:38 +0100 (BST) Received: from [106.109.130.31] by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NB900IDXSK12I60@eusync1.samsung.com>; Tue, 02 Sep 2014 11:45:38 +0100 (BST) Message-id: <54059FD1.1050308@partner.samsung.com> Date: Tue, 02 Sep 2014 10:45:00 -0000 From: Maxim Ostapenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-version: 1.0 To: binutils@sourceware.org, ams@codesourcery.com, nickc@redhat.com Cc: Yury Gribov , Slava Garbuzov Subject: Tag_CPU_name merging produces wrong tag for ARM. References: <54058B98.8040506@partner.samsung.com> In-reply-to: <54058B98.8040506@partner.samsung.com> X-Forwarded-Message-Id: <54058B98.8040506@partner.samsung.com> Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 7bit X-SW-Source: 2014-09/txt/msg00007.txt.bz2 Add Andrew Stubbs and Nick Clifton as author and reviewer of ARM attributes merging patch ( https://sourceware.org/ml/binutils/2009-01/msg00156.html). -------- Original Message -------- Subject: [Bug ld/17212] Tag_CPU_name merging produces wrong tag for ARM. Date: Tue, 02 Sep 2014 13:19:20 +0400 From: Maxim Ostapenko To: binutils@sourceware.org CC: Yury Gribov , Slava Garbuzov Hi, I tried to compile a binary optimized for ARM Cortex-A15 with ARM Cortex-A8 cross-toolchain (host is x86_64-pc-linux-gnu), but Tag_CPU_name appears to be "Cortex-A8" for the binary instead of "Cortex-A15". The example session follows: $ arm-v7a8-linux-gnueabi-gcc -O2 -mcpu=cortex-a15 divtest.c -o divtest.a15 $ readelf -A divtest.a15 Attribute Section: aeabi File Attributes Tag_CPU_name: "Cortex-A8" Tag_CPU_arch: v7 ................................................ Tag_DIV_use: Allowed in v7-A with integer division extension After some investigation I found out, that Tag_CPU_name merging based on Tag_CPU_arch. Since the first file to appear during linking is crt1.o, which has Tag_CPU_name: "Cortex-A8" for A8 toolchain, the result binary's Tag_CPU_name is also "Cortex-A8". Is this expected behavior of ld, or maybe tags should be merged to a more specific "Cortex-A15"? Perhaps we should use Tag_DIV_use when merging names? -Maxim