Package: binutils-gold
Severity: important
Version: 2.22-8
Tags: upstream

I have recently found that the gold linker incorrectly links a FUSE
application to an old (/arbitary?) API level of a function.

In order to reproduce and demonstrate this issue, in a jessie
cowbuilder environment the following steps can be  followed:

install git, pkg-config, libfuse-dev, vim-common, the in a directory
such as /tmp clone the tup source tree into two distinct directories:

root@heidi:/tmp# git clone http://github.com/eddyp/tup.git tup-bfd
Cloning into 'tup-bfd'...
remote: Counting objects: 18671, done.
remote: Compressing objects: 100% (8339/8339), done.
remote: Total 18671 (delta 10447), reused 17666 (delta 9494)
Receiving objects: 100% (18671/18671), 9.91 MiB | 599 KiB/s, done.
Resolving deltas: 100% (10447/10447), done.
root@heidi:/tmp# git clone tup-bfd tup-gold
Cloning into 'tup-gold'...
done.

(the failing commit is 81d0371 and is tagged 'binutils-gold-bug')


Then try to build with bfd linker (the build will fail, if ran in a
cowbuilder jessie chroot, it's OK).

root@heidi:/tmp# cd tup-bfd/
root@heidi:/tmp/tup-bfd# ld --version
GNU ld (GNU Binutils for Debian) 2.22
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
root@heidi:/tmp/tup-bfd# ./bootstrap.sh
  mkdir build
  cd build
...
[ tup ] [0.382s] Parsing Tupfiles...
fuse: device not found, try 'modprobe fuse' first
fuse_mount: No such file or directory
tup error: Unable to mount FUSE on .tup/mnt


The bfd linker will correctly link the elf to use the fuse_new@FUSE_2.6 version:


root@heidi:/tmp/tup-bfd# readelf -a build/tup | grep fuse_new
00000072e960  002b00000007 R_X86_64_JUMP_SLO 0000000000000000 fuse_new + 0
    43: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND fuse_new@FUSE_2.6 (9)
  2984: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND fuse_new@@FUSE_2.6




But with the gold linker:


root@heidi:/tmp/tup-bfd# cd ../tup-gold/
root@heidi:/tmp/tup-gold# aptitude install binutils-gold
root@heidi:/tmp/tup-gold# ld --version
GNU gold (GNU Binutils for Debian 2.22) 1.11
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
root@heidi:/tmp/tup-gold# ./bootstrap.sh
  mkdir build
  cd build
...
[ tup ] [0.385s] Parsing Tupfiles...
fuse: device not found, try 'modprobe fuse' first
fuse_mount: No such file or directory
tup error: Unable to mount FUSE on .tup/mnt


The linker does not correctly link the elf to the fuse_new@FUSE_2.6

root@heidi:/tmp/tup-gold# readelf -a build/tup | grep fuse_new
00000052fb88  005000000007 R_X86_64_JUMP_SLO 0000000000000000 fuse_new + 0
    80: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND fuse_new
  3197: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND fuse_new




More detail of the issue are at:
https://github.com/gittup/tup/issues/134


-- 
Regards,
EddyP
=============================================
The universe is not required to be in perfect harmony with human
ambition. - Carl Sagan


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to