http://sourceware.org/bugzilla/show_bug.cgi?id=12826
Summary: [PATCH] Gold not knowing ARM7EM architecture
Product: binutils
Version: 2.21
Status: NEW
Severity: normal
Priority: P2
Component: gold
AssignedTo: [email protected]
ReportedBy: [email protected]
Created attachment 5760
--> http://sourceware.org/bugzilla/attachment.cgi?id=5760
Patch with the proposed change
When compiling code with gcc-4.6.0 for cpu "cortex-m4" it generates code for
ARM7EM. The gold 2.21 linker tells: "unknown CPU architecture".
The error is in line 10006 of gold/arm.cc:
if (oldtag >= elfcpp::MAX_TAG_CPU_ARCH || newtag >= elfcpp::MAX_TAG_CPU_ARCH)
This detects an error in the architecture, but if the oldtag or newtag is just
the same as elfcpp::MAX_TAG_CPU_ARCH, it detects it incorrectly as unknown CPU.
Line 242 of elfcpp/arm.h:
MAX_TAG_CPU_ARCH = TAG_CPU_ARCH_V7E_M
So it is as simple to fix as changing previous line by:
if (oldtag > elfcpp::MAX_TAG_CPU_ARCH || newtag > elfcpp::MAX_TAG_CPU_ARCH)
So the value TAG_CPU_ARCH_V7E_M is not detected as an unknown CPU.
Included patch for easy applying.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils