Project

General

Profile

Bug #1917

linking OsmocomBB firmware fails on binutils 2.27

Added by laforge over 3 years ago. Updated about 1 year ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
OsmocomBB Firmware
Target version:
-
Start date:
01/15/2017
Due date:
% Done:

100%

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.

Associated revisions

Revision d7202e16 (diff)
Added by laforge 6 months ago

firmware/Makefile.inc: fix sections with overlapping VMA

Starting from [1], not only LMA but also VMA areas are now checked
for overlaps (see also [2]). This results into linking errors:

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]

Let's try to work around this.

[1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a87dd97a2098b7e18ff2574a4e81ae521ef7e6f2
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=18452

Change-Id: I098ddd33aabd7ec27981e2f09d8582f167bb649b
Fixes: OS#1917

History

#1 Updated by niklas almost 3 years 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 almost 3 years 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 over 2 years 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 over 2 years 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 over 2 years 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 about 2 years 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 about 2 years 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 about 2 years 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

#9 Updated by fixeria about 1 year ago

  • Category set to OsmocomBB Firmware
  • Status changed from New to Feedback
  • Assignee set to fixeria
  • Priority changed from Normal to High
  • % Done changed from 0 to 90

Please see: https://gerrit.osmocom.org/#/c/osmocom-bb/+/14006/

I've tested the patch from Harald with the recent (9.1.0-1) cross compiler, as well as some older (4.5.2, 4.8.2) ones.
The firmware builds just fine, and works on my Compal E88 board (Motorola C118).

#10 Updated by fixeria about 1 year ago

  • Status changed from Feedback to Resolved
  • % Done changed from 90 to 100

Patch is merged, the issue should have been fixed now. Please (re)open if not.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)