Project

General

Profile

Bug #1917

linking OsmocomBB firmware fails on binutils 2.27

Added by laforge over 1 year ago. Updated 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
01/15/2017
Due date:
% Done:

0%

Estimated time:
Resolution:
Spec Reference:

Description

On modern binutils (tested with 2.27), we get linker errors like this:

arm-none-eabi-ld: section .text.exceptions VMA [000000000080001c,0000000000800037] overlaps section .compal.reservedram VMA [0000000000800000,00000000008000fe]
arm-none-eabi-ld: section .text.exceptions VMA [000000000080001c,0000000000800037] overlaps section .compal.loader VMA [0000000000800000,00000000008000ff]

It seems related to the changes introduced by https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a87dd97a2098b7e18ff2574a4e81ae521ef7e6f2 (see also https://sourceware.org/bugzilla/show_bug.cgi?id=18452) where not only LMA but also VMA areas are now checked for overlaps.

History

#1 Updated by niklas 10 months ago

I'm facing the same, with binutils 2.28. Is there any known workaround? Looking at the patch above there doesn't seem to be an option to disable that check.

Besides that, could someone point out why those overlaps aren't a real bug to begin with?

#2 Updated by libomnomnom-dev 9 months ago

niklas wrote:

I'm facing the same, with binutils 2.28. Is there any known workaround?

One can resolve the issue straight ahead by editing `ram.lds` and other LD segment definition files lying under `osmocom-bb/src/target/firmware/board/` so that the memory segments don't overlap, yet point to the same addresses as before.

While I did manage to make the linker happy, the resulting binaries don't make the phone appear alive (yet?).

#3 Updated by 0x00 8 months ago

Hello,
Just got the same error. What must be the right binutils version to overcome this issue? I am planning to downgrade my binutils 2.29 to a older one.

#4 Updated by 0x00 8 months ago

0x00 wrote:

Hello,
Just got the same error. What must be the right binutils version to overcome this issue? I am planning to downgrade my binutils 2.29 to an older one.

#5 Updated by laforge 4 months ago

I had tried to get this to work in the laforge/binutils branch of osmocom-bb.git a long time ago but never found the time to complete and/or verify it. But it mightt be a good pointer if anyone wants to contribute a real fix.

#6 Updated by laforge 2 months ago

libomnomnom-dev wrote:

One can resolve the issue straight ahead by editing `ram.lds` and other LD segment definition files lying under `osmocom-bb/src/target/firmware/board/` so that the memory segments don't overlap, yet point to the same addresses as before.

The entire point of those linker scripts is to produce overlapping segments/mappings/adresses. They are essential and required :)

#7 Updated by Dr.Lafa 2 months ago

I have the same problem on Debian 9.4 with binutils 2.28
I used precompiled arm toolchain from debian stretch repo's (binutils-arm-none-eabi gcc-arm-none-eabi gdb-arm-none-eabi libstdc++-arm-none-eabi-newlib)

Does anybody know a crutch helping to solve this problem?

#8 Updated by Dr.Lafa 2 months ago

ok i found this crutch. It is can be compiled in Debian 9.4 x86_64 with gcc 4.9.4, binutils 2.21.1a and newlib 1.19.0

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)