10.04: binutils-gold is out of date

Bug #673893 reported by Konstantin Serebryany
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
binutils (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: binutils

binutils-gold (2.20.1-3ubuntu7) seems to be too old in 10.04.
The version of gold available with apt-get fails to correctly link a static binary (the fresh gold works fine).

% cat st.cc
#include <stdio.h>
int main() {
  int c = 1;
  int res = sscanf("123", "%d", &c);
  fprintf(stderr, "XXX: %d %d\n", res, c);
}
% g++ st.cc -static && ./a.out
XXX: 1 123
% sudo apt-get install binutils-gold
...
% g++ st.cc -static && ./a.out
XXX: -1 1
% sudo apt-get remove binutils-gold
...
% g++ st.cc -static && ./a.out
XXX: 1 123

Revision history for this message
Ian Lance Taylor (ianlancetaylor) wrote :

The problem is that the libc is using STT_GNU_IFUNC symbols. In order to get a version of gold with STT_GNU_IFUNC support, Ubuntu needs to use gold version 100820 or newer. The gold in the GNU binutils 2.21 release should work fine.

Revision history for this message
strk (strk) wrote :

This bug costed me a day fighting with bad ugly dragons.
Would be nice to save others from that experience.

Revision history for this message
strk (strk) wrote :

To give more context to the dragons:

To reproduce:
 git clone git://github.com/strk/postgis.git
 cd postgis && git checkout 728e94ab0325a89fa3ac4548d8617d144a0ab717
 ./autogen.sh && ./configure && make all
 cd liblwgeom/cunit && make check

Expected result:
 no segfault

Obtained result:
 segfault

I've spent hours moving code around in cu_tester.c or some tests
and could handle to avoid the segfault, but it made no sense.
Valgrind reported somethign like:

 ==31508== Bad permissions for mapped region at address 0x4885E0

And gdb found it comin from strcmp or strlen...

Linking cu_tester with "the other" linker works fine.

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

the ubuntu-toolchain-r/test PPA has an updated package.

Revision history for this message
Jonathan Davies (jpds) wrote :

The package in the above PPA appears to work as expected in a Lucid virtual machine.

Revision history for this message
Micah Gersten (micahg) wrote :

We actually need to break the -gold binary out into its own source package and drop it from the main binutils package to update this.

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

closing this as won't fix. the 12.04 LTS has a working gold, and for 10.04 (lucid), please use the package from the PPA

Changed in binutils (Ubuntu):
status: New → Won't Fix
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.