Bug#519006: mips/ld: non-dynamic relocations refer to dynamic symbol

2010-09-14 Thread Aurelien Jarno
reassign 519006 binutils
tag 519006 + patch
forwarded 519006 http://sourceware.org/ml/binutils/2010-09/msg00216.html
thanks

On Tue, Sep 14, 2010 at 05:27:04PM +0200, Aurelien Jarno wrote:
> I have done a rebuilt of part of the archive using gcc-4.4 that defaults
> to -mplt. Unfortunately I don't have enough CPU power to rebuild the
> whole archive, so I have rebuilt all packages with priority >= important
> as well as 436 packages selected randomly with priority optional (see
> list below). I have got a few build failures but, not due to the -mplt
> change.
> 

Unfortunately we've just discovered that while this approach works for 
most of the cases, it doesn't work for all packages.

On the other hand the good news is that Maciej Rozycki has written a
patch for binutils which fixes the real issue. I have converted it to 
dpatch and attached to this mail. I have tested on a few packages that
currently fail because of this bug, and they now all build correctly.

-- 
Aurelien Jarno  GPG: 1024D/F1BCDB73
aurel...@aurel32.net http://www.aurel32.net
#!/bin/sh -e
## 150_pr10144.dpatch
##
## DP: Description: http://sourceware.org/ml/binutils/2010-09/msg00216.html 

if [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

case "$1" in
   -patch) patch $patch_opts -p0 < $0;;
   -unpatch) patch $patch_opts -p0 -R < $0;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as 
argument"
exit 1;;
esac

exit 0

2010-09-15  Maciej W. Rozycki  

PR ld/10144

bfd/
* elfxx-mips.c (_bfd_mips_elf_check_relocs)
[R_MIPS_32, R_MIPS_REL32, R_MIPS_64]: Ignore relocs from
SEC_DEBUGGING sections.

ld/testsuite/
* lib/ld-lib.exp (run_ld_link_tests): Handle sources from other
directories.
(run_ld_link_exec_tests): Likewise.
(run_cc_link_tests): Likewise.
* ld-elf/comm-data1.sd: New test.
* ld-elf/comm-data1.s: Source for the new test.
* ld-elf/comm-data2.sd: New test.
* ld-elf/comm-data2.rd: Likewise.
* ld-elf/comm-data2.xd: Likewise.
* ld-elf/comm-data2.s: Source for the new tests.
* ld-elf/comm-data.exp: Run the new tests.
* ld-mips-elf/comm-data.exp: Likewise.

Index: ld/testsuite/ld-elf/comm-data1.s
===
--- ld/testsuite/ld-elf/comm-data1.s(revision 0)
+++ ld/testsuite/ld-elf/comm-data1.s(revision 0)
@@ -0,0 +1,6 @@
+   .section .rodata,"a",%progbits
+   .balign 8
+   .globl  foo
+   .type   foo,%object
+foo:
+   .skip   4, 0
Index: ld/testsuite/ld-elf/comm-data2.xd
===
--- ld/testsuite/ld-elf/comm-data2.xd   (revision 0)
+++ ld/testsuite/ld-elf/comm-data2.xd   (revision 0)
@@ -0,0 +1,2 @@
+Hex dump of section '\.debug_foo':
+ +0x0+ +    +\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.
Index: ld/testsuite/ld-elf/comm-data2.s
===
--- ld/testsuite/ld-elf/comm-data2.s(revision 0)
+++ ld/testsuite/ld-elf/comm-data2.s(revision 0)
@@ -0,0 +1,14 @@
+   .text
+   .globl  _start
+   .globl  __start
+_start:
+__start:
+   .comm   foo, 4, 4
+   .section .debug_foo,"",%progbits
+   .balign 16
+   .ifdef  ELF64
+   .8byte  foo
+   .else
+   .4byte  foo
+   .endif
+   .balign 16
Index: ld/testsuite/ld-elf/comm-data.exp
===
--- ld/testsuite/ld-elf/comm-data.exp   (revision 0)
+++ ld/testsuite/ld-elf/comm-data.exp   (revision 0)
@@ -0,0 +1,76 @@
+# Expect script for common symbol override.
+#
+#   Copyright 2010  Free Software Foundation, Inc.
+#
+# This file is part of the GNU Binutils.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+#
+
+#
+# Written by Maciej W. Rozycki 
+#
+
+# Exclude non-ELF targets.
+if ![is_elf_format] {
+return
+}
+
+# Exclude non-Linux targets; feel free to include your favourite one
+# if you 

Bug#519006: mips/ld: non-dynamic relocations refer to dynamic symbol

2010-09-14 Thread Aurelien Jarno
On Mon, Aug 30, 2010 at 10:44:25PM +0200, Aurelien Jarno wrote:
> Hi all,
> 
> I have made some progress on this bug, though it has not progress in the
> expected direction. In other words I got some surprises.
> 
> First of all it the bug has been introduced in binutils when introducing
> the MIPS PLT support [1] (commits around 2008-08-08). I am still
> convinced it is actually a binutils bug. Secondly, if the problem is
> actually not present in gcc-snapshot in gcc 4.5 we have *in Debian*, it
> is not due to the fix linked in the bugzilla entry. It is due to the
> fact we default to -mplt on these compilers. It is possible to
> workaround the bug on gcc 4.4 using -mplt (like it is possible to 
> workaround it by dropping the -g).
> 
> Given all of that, the only forseen solution for this fix is to also
> default to -mplt on gcc 4.4. It also brings speed improvements, as 
> well as some more "standard" binaries with regard to other 
> architectures. On the other hand, I understand it is something quite 
> risky so close to a release. If we go for this solution, we may want
> to trigger a rebuild of part of the archive as it is currently done
> on sparc.
> 

I have done a rebuilt of part of the archive using gcc-4.4 that defaults
to -mplt. Unfortunately I don't have enough CPU power to rebuild the
whole archive, so I have rebuilt all packages with priority >= important
as well as 436 packages selected randomly with priority optional (see
list below). I have got a few build failures but, not due to the -mplt
change.

failures

apt-rpm_0.5.15lorg3.2-6 (#533164)
libavg_1.0.1-1 (#580678)
libgdchart-gd2_0.11.5-6 (#564374)
mixxx_1.7.2-1 (#587110)
time_1.7-23 (sbuild bug)

successes
-
3depict_0.0.1-1
aboot_1.0~pre20040408-3
acl_2.2.49-3
adanaxisgpl_1.2.5.dfsg.1-3
afio_2.5-5
agave_0.4.7-1
agg_2.5+dfsg1-3
aide_0.15-2
alure_1.0-2
amide_0.9.2-1
apron_0.9.10-5
apt_0.8.3
apt-build_0.12.37
aptitude_0.6.3-3.1
aptsh_0.0.7+nmu1
ap-utils_1.5-2
archivemount_0.6.1-1
arpon_2.0-2
artha_1.0.1-1
at_3.1.12-1
atom4_4.1-4
attr_2.4.44-2
autoclass_3.3.6-1
autodocksuite_4.2.3-1
autounit_0.20.1-3
avida_2.0b7-4.2
awffull_3.8.2-1.3
ballz_1.0.1-2
bandwidthd_2.0.1+cvs20090917-4
barrage_1.0.2-4
base-files_5.9
base-passwd_3.5.22
bash_4.1-3
bc_1.06.95-2
bibindex_2.10-10
bind9_9.7.1.dfsg.P2-2
bison_1:2.4.1.dfsg-3
bitmeter_1.2-2
bkhive_1.1.1-1
blast_1.1-22
boa_0.94.14rc21-3.1
bognor-regis_0.5.2-2
bombardier_0.8.3+nmu1
boost1.42_1.42.0-4
bsd-mailx_8.1.2-0.20100314cvs-1
bsdmainutils_8.0.13
bygfoot_2.3.2-1
bzip2_1.0.5-5
c2hs_0.16.2-1
cachefilesd_0.9-3
cairo-5c_1.4
canorus_0.7-2
cassbeam_1.0-8
ccache_3.0.1-1
cheesetracker_0.9.15.3-4
cherokee_1.0.8-1
chise-base_0.3.0-2
claws-mail_3.7.6-2
clex_3.15-1
cln_1.3.1-2
cl-uffi_2.0.0-1
coq_8.2.pl2+dfsg-1
coreutils_8.5-1
couchdb_0.11.0-2
cpio_2.11-4
crimson_0.5.2-1
cron_3.0pl1-114
crossfire_1.50.0-1
cryptgps_0.2.1-7
cwidget_0.5.16-3
cyrus-sasl2_2.1.23.dfsg1-6
darcs_2.4.4-2
darkice_0.20.1-3
dash_0.5.5.1-7
db4.5_4.5.20-13.2
db4.6_4.6.21-16
db4.7_4.7.25-9
db4.8_4.8.30-2
dctrl-tools_2.14.1
ddns3-client_1.8-7
dealer_0.20040530-3
debian-installer_20100722
debianutils_3.4
dhcp3_3.1.3-2
diffpdf_1.1.4-1
diffutils_3.0-1
dime_0.20030921-2
docbook-to-man_1:2.0.0-28
doscan_0.3.1-3
dossizola_1.0-8.2
dovecot-antispam_1.2+20090702-1
dpkg_1.15.8.4
dvblast_1.2-1
e2fsprogs_1.41.12-2
eboard_1.1.1-4.1
eglibc_2.11.2-5
ejabberd_2.1.5-1
ekiga_3.2.7-2
elementtidy_1.0-7
elinks_0.12~pre5-2
encfs_1.6.1-1
espeak_1.43.03-2
evolution-webcal_2.28.1-1
exempi_2.1.1-1
exim4_4.72-1
exiv2_0.20-2
expect_5.44.1.15-3
fastdep_0.16-13
fast-user-switch-applet_2.24.0-4
fetchmail_6.3.17-4
file_5.04-5
filters_2.46
findutils_4.4.2-1
firebird2.1_2.1.3.18185-0.ds1-11
firestarter_1.0.3-8
fkiss_0.35-1.1
floatbg_1.0-28
focal_1.0.1-1
font-manager_0.5.6-1
freefem_3.5.8-4.2
frox_0.7.18-4
fspanel_0.7-9
fsvs_1.1.17-1
fteqcc_3343+svn3400-2
fxload_0.0.20081013-1
g2_0.72-1
g3dviewer_0.2.99.5~svn130-1
gcc-4.1_4.1.2-29
gcin_1.4.6-3
gcolor2_0.4-2
gconf-editor_2.30.0-2
gdbm_1.8.3-9
gedit_2.30.3-1
geg_1.0.2-6
gelemental_1.2.0-4
gettext_0.18.1.1-1
gigolo_0.4.1-1
gimp-plugin-registry_3.5.1-1
gip_1.7.0-1-2
gkremldk_0.9.7-2
glabels_2.2.8-1
gle_3.1.0-7
glfw_2.6-2
gloox_1.0-1
glpk_4.43-1
glui_2.36-4
gnash_0.8.8-2
gnet_2.0.8-2
gnokii_0.6.29.dfsg-1
gnomint_1.1.0-1
gnubg_0.90+20091206-4
gnupg_1.4.10-4
gnuspool_1.7
gnustep-examples_1:1.2.0-3
gnutls26_2.8.6-1
goattracker_2.70-1
gocr_0.48-1
gpe-su_0.20-1
gpe-todo_0.58-1
gpm_1.20.4-3.3
gpx2shp_0.69-3
grads_2.0.a8-1
granule_1.3.0-1
grass_6.4.0~rc6+42329-1
grep_2.6.3-3
groff_1.20.1-10
gsl_1.14+dfsg-1
gtkboard_0.11pre0-12
gtk-theme-switch_2.1.0-2
gtools_2.6.2-1
gtweakui_0.4.0-2
guayadeque_0.2.5-2
gwaei_1.4.1-2
gzip_1.3.12-9
havp_0.91-1.1
hfsplus_1.0.4-12
hildon-theme-tools_0.5.2.debian.1-2
hmisc_3.8-2-1
hostname_3.04
hspell-gui_0.2.6-4.1
html2text_1.3.2a-15
icecc-monitor_2.0~svn951472-2
ifenslave-2.6_1.1.0-17
ifrit_3.3.2-1
ifupdown_0.6.10
igaelic_0.50-7
ii_1.4-3
imagination_2.1-2
infernal_1.0.2-1
inkscape_0.47.0-2
iproute_

Bug#519006: mips/ld: non-dynamic relocations refer to dynamic symbol

2010-09-01 Thread Rtp
Aurelien Jarno  writes:

> Hi all,

Hi,
>
> I have made some progress on this bug, though it has not progress in the
> expected direction. In other words I got some surprises.
>
> First of all it the bug has been introduced in binutils when introducing
> the MIPS PLT support [1] (commits around 2008-08-08). I am still
> convinced it is actually a binutils bug. Secondly, if the problem is
> actually not present in gcc-snapshot in gcc 4.5 we have *in Debian*, it
> is not due to the fix linked in the bugzilla entry. It is due to the
> fact we default to -mplt on these compilers. It is possible to
> workaround the bug on gcc 4.4 using -mplt (like it is possible to 
> workaround it by dropping the -g).

To sum up, there's no fix upstream for the bug but the
solution/workaround for now is -mplt, right ?

>
> Given all of that, the only forseen solution for this fix is to also
> default to -mplt on gcc 4.4. It also brings speed improvements, as 
> well as some more "standard" binaries with regard to other 
> architectures. On the other hand, I understand it is something quite 
> risky so close to a release. If we go for this solution, we may want

If the bug is "fixed" by this change and as a side effect, there are
improvements, there's no reason to not include it. I don't think it can
be worse than the current situation. Moreover (iirc) this bug is a
release blocker for mips so seeing it closed would be really nice.

> to trigger a rebuild of part of the archive as it is currently done
> on sparc.

There's a bunch of packages known to be bitten by this bug but there may
be others we're not aware of. imho a rebuild is mandatory. This would
also give us a good up-to-date status of the mips/mipsel ports for the
release.

My 2 cents,
Arnaud



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



Bug#519006: mips/ld: non-dynamic relocations refer to dynamic symbol

2010-08-30 Thread Aurelien Jarno
Hi all,

I have made some progress on this bug, though it has not progress in the
expected direction. In other words I got some surprises.

First of all it the bug has been introduced in binutils when introducing
the MIPS PLT support [1] (commits around 2008-08-08). I am still
convinced it is actually a binutils bug. Secondly, if the problem is
actually not present in gcc-snapshot in gcc 4.5 we have *in Debian*, it
is not due to the fix linked in the bugzilla entry. It is due to the
fact we default to -mplt on these compilers. It is possible to
workaround the bug on gcc 4.4 using -mplt (like it is possible to 
workaround it by dropping the -g).

Given all of that, the only forseen solution for this fix is to also
default to -mplt on gcc 4.4. It also brings speed improvements, as 
well as some more "standard" binaries with regard to other 
architectures. On the other hand, I understand it is something quite 
risky so close to a release. If we go for this solution, we may want
to trigger a rebuild of part of the archive as it is currently done
on sparc.

Cheers,
Aurelien

[1] http://readlist.com/lists/gcc.gnu.org/gcc/4/22455.html

diff -u gcc-4.4-4.4.4/debian/changelog gcc-4.4-4.4.4/debian/changelog
--- gcc-4.4-4.4.4/debian/changelog
+++ gcc-4.4-4.4.4/debian/changelog
@@ -1,3 +1,10 @@
+gcc-4.4 (4.4.4-11+mipsplt) UNRELEASED; urgency=low
+
+  [ Aurelien Jarno ]
+  * Default to -mplt on mips(el).
+
+ -- Aurelien Jarno   Mon, 30 Aug 2010 15:58:29 +
+
 gcc-4.4 (4.4.4-11) unstable; urgency=medium
 
   * Update to SVN 20100824 from the gcc-4_4-branch (r163521).
diff -u gcc-4.4-4.4.4/debian/rules2 gcc-4.4-4.4.4/debian/rules2
--- gcc-4.4-4.4.4/debian/rules2
+++ gcc-4.4-4.4.4/debian/rules2
@@ -384,12 +384,14 @@
 endif
 
 ifneq (,$(findstring mips-linux,$(DEB_TARGET_GNU_TYPE)))
+  CONFARGS += --with-mips-plt
   ifeq ($(biarchn32)-$(biarch64),yes-yes)
 CONFARGS += --enable-targets=all
   endif
 endif
 
 ifneq (,$(findstring mipsel-linux,$(DEB_TARGET_GNU_TYPE)))
+  CONFARGS += --with-mips-plt
   ifeq ($(biarchn32)-$(biarch64),yes-yes)
 CONFARGS += --enable-targets=all
   endif

-- 
Aurelien Jarno  GPG: 1024D/F1BCDB73
aurel...@aurel32.net http://www.aurel32.net



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



Bug#519006: mips/ld: non-dynamic relocations refer to dynamic symbol

2010-06-12 Thread Aurelien Jarno
reassign 519006 gcc-4.4
found 519006 4.4.2-8
thanks

This bug is actually a GCC bug, present in 4.4 and fixed in 4.5. The
patch that fixes the problem is available [1], but is not easily
backportable without good GCC knowledge.

A workaround to this bug is to not compile with -g.

[1] http://gcc.gnu.org/ml/gcc-patches/2009-09/msg02070.html

-- 
Aurelien Jarno  GPG: 1024D/F1BCDB73
aurel...@aurel32.net http://www.aurel32.net



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



Bug#519006: mips/ld: non-dynamic relocations refer to dynamic symbol

2010-01-01 Thread Thorsten Glaser
Hi,

while fixing #531937 I found out how to create a very minimalistic
testcase. Apparently the diagnosis that ld cannot “override” libc
symbols with local symbols was correct.

I have created an attachment to the upstream-filed bug at:
http://sources.redhat.com/bugzilla/show_bug.cgi?id=10144

I eventually fixed #531937 since the real bug was something else
that only happened to be noticed because of this toolchain bug,
but actually may have affected the programme negatively, so this
bug can be used for testing ☺

HTH & HAND,
//mirabilos
-- 
Sometimes they [people] care too much: pretty printers [and syntax highligh-
ting, d.A.] mechanically produce pretty output that accentuates irrelevant
detail in the program, which is as sensible as putting all the prepositions
in English text in bold font.   -- Rob Pike in "Notes on Programming in C"



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