Unrecognized relocation when compiling

Bug #1545653 reported by Alexander List
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
binutils
Fix Released
Unknown
binutils (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I am trying to compile a program against a library that was built using gcc 5.3 on Wily, which has gcc 5.2.1.

I get

/usr/bin/ld: <REMOVED>: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

This looks exactly like

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808205

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: binutils 2.25.1-6ubuntu2
ProcVersionSignature: User Name 4.2.0-27.32-generic 4.2.8-ckt1
Uname: Linux 4.2.0-27-generic x86_64
ApportVersion: 2.19.1-0ubuntu5
Architecture: amd64
Date: Mon Feb 15 09:53:05 2016
Dependencies:
 gcc-5-base 5.2.1-22ubuntu2
 libc6 2.21-0ubuntu4
 libgcc1 1:5.2.1-22ubuntu2
 zlib1g 1:1.2.8.dfsg-2ubuntu4
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: binutils
UpgradeStatus: Upgraded to wily on 2016-02-13 (2 days ago)

Revision history for this message
Alexander List (alexlist) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in binutils (Ubuntu):
status: New → Confirmed
Revision history for this message
Matthias Klose (doko) wrote :

I don't see a relation to the Debian issue, which was caused by an early binutils 2.26 snapshot.

Changed in binutils (Ubuntu):
status: Confirmed → Incomplete
Changed in binutils:
status: Unknown → Fix Released
Revision history for this message
Leandro Heck (leoheck) wrote :

I still having this problem. I am trying to build an app on Ubuntu 16.04 using a separated gcc-toolchain (gcc-4.7.4-linux_x86_64). This toolchain comes from Mentor Questa which I have to use to build my SystemC applications. A simple hello world using this toolchain reproduces the problem.

#include <stdio.h>
int main() {
    fprintf(stdout, "Hello, world.\n");
    return(0);
}

I managed to solve that removing the ld which comes with the external toolchain by the ld from the system. A simple symbolic link had solved the problem.

However, I am looking for a more elegant way to change ld like a gcc flag or an environment variable.

I would like to ask if someone has some idea on how to do that.

By the way, my system is currently configured with:

Package: binutils - Version: 2.26.1-1ubuntu1~16.04.3
Package: libgcc1 - Version: 6.0.1-0ubuntu1
Package: libc6 - Version: 2.23-0ubuntu3
Package: gcc - Version: 5.3.1-1ubuntu1

Revision history for this message
Matthias Klose (doko) wrote :

you can use the -B option to specify a separate path where to look for tools. Closing this now.

Changed in binutils (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.