10.04: binutils-gold is out of date
Bug #673893 reported by
Konstantin Serebryany
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
To post a comment you must log in.
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.