This is the mail archive of the
mailing list for the binutils project.
Tag_CPU_name merging produces wrong tag for ARM.
- From: Maxim Ostapenko <m dot ostapenko at partner dot samsung dot com>
- To: binutils at sourceware dot org, ams at codesourcery dot com, nickc at redhat dot com
- Cc: Yury Gribov <y dot gribov at samsung dot com>, Slava Garbuzov <v dot garbuzov at samsung dot com>
- Date: Tue, 02 Sep 2014 14:45:37 +0400
- Subject: Tag_CPU_name merging produces wrong tag for ARM.
- Authentication-results: sourceware.org; auth=none
- References: <54058B98 dot 8040506 at partner dot samsung dot com>
Add Andrew Stubbs and Nick Clifton as author and reviewer of ARM
attributes merging patch (
-------- 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 <firstname.lastname@example.org>
CC: Yury Gribov <email@example.com>, Slava Garbuzov
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
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?