Project

General

Profile

Actions

Bug #1917

closed

linking OsmocomBB firmware fails on binutils 2.27

Added by laforge about 7 years ago. Updated almost 5 years 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.

Actions #1

Updated by niklas over 6 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?

Actions #2

Updated by libomnomnom-dev over 6 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?).

Actions #3

Updated by 0x00 over 6 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.

Actions #4

Updated by 0x00 over 6 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.

Actions #5

Updated by laforge about 6 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.

Actions #6

Updated by laforge almost 6 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 :)

Actions #7

Updated by Dr.Lafa almost 6 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?

Actions #8

Updated by Dr.Lafa almost 6 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

Actions #9

Updated by fixeria almost 5 years 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).

Actions #10

Updated by fixeria almost 5 years 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.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)