Bug 12637 - mips-linux-gnu: relocation truncated to fit: R_MIPS_TLS_LDM
Summary: mips-linux-gnu: relocation truncated to fit: R_MIPS_TLS_LDM
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: rsandifo@nildram.co.uk
URL:
Keywords:
: 12606 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-04-05 11:00 UTC by Matthias Klose
Modified: 2021-09-15 02:39 UTC (History)
3 users (show)

See Also:
Host:
Target: mips-linux-gnu
Build:
Last reconfirmed:


Attachments
natClass.o (60.00 KB, application/x-gzip)
2011-04-05 11:01 UTC, Matthias Klose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2011-04-05 11:00:18 UTC
gcj/libjava fails to build on mips{,el]-linux-gnu, when linking libgcj, with current gcc-4_4-branch and gcc-4_6-branch. The link succeeds with binutils 2.20.1, but fails with the binutils-2.21.1 branch.

[...]
java/lang/.libs/natClass.o: In function `_Jv_FindMethodInCache':
/home/doko/gcc/4.4/gcj-4.4-4.4.5/build/mips-linux-gnu/libjava/../../../src/libjava/java/lang/natClass.cc:1699: relocation truncated to fit: R_MIPS_TLS_LDM against `method_cache'
java/lang/.libs/natClass.o: In function `_Jv_AddMethodToCache':
/home/doko/gcc/4.4/gcj-4.4-4.4.5/build/mips-linux-gnu/libjava/../../../src/libjava/java/lang/natClass.cc:1720: relocation truncated to fit: R_MIPS_TLS_LDM against `method_cache'
java/lang/.libs/natClass.o: In function `_Jv_FreeMethodCache()':
/home/doko/gcc/4.4/gcj-4.4-4.4.5/build/mips-linux-gnu/libjava/../../../src/libjava/java/lang/natClass.cc:1739: relocation truncated to fit: R_MIPS_TLS_LDM against `method_cache'
collect2: ld returned 1 exit status
make[5]: *** [libgcj.la] Error 1
make[5]: Leaving directory `/home/doko/gcc/4.4/gcj-4.4-4.4.5/build/mips-linux-gnu/libjava'
make[4]: *** [all-recursive] Error 1

complete build logs at
https://buildd.debian.org/status/package.php?p=gcj-4.4
https://buildd.debian.org/status/package.php?p=gcj-4.6

will attach used files later this week
Comment 1 Matthias Klose 2011-04-05 11:01:59 UTC
Created attachment 5645 [details]
natClass.o
Comment 2 Matthias Klose 2011-04-08 10:29:45 UTC
seen with binutils trunk too.

object files for the link:
http://people.debian.org/~doko/tmp/libjava-link.tgz
Comment 3 H.J. Lu 2011-04-08 22:27:32 UTC
*** Bug 12606 has been marked as a duplicate of this bug. ***
Comment 4 rsandifo@nildram.co.uk 2011-04-10 10:52:17 UTC
About to commit a patch.
Comment 5 Sourceware Commits 2011-04-10 11:10:35 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	rsandifo@sourceware.org	2011-04-10 11:10:31

Modified files:
	bfd            : elfxx-mips.c ChangeLog 

Log message:
	bfd/
	PR ld/12637
	* elfxx-mips.c (mips_elf_merge_got_with): Use arg->global_count
	as the number of global entries when merging with the primary GOT.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elfxx-mips.c.diff?cvsroot=src&r1=1.282&r2=1.283
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.5298&r2=1.5299
Comment 6 rsandifo@nildram.co.uk 2011-04-10 11:11:36 UTC
Fixed on trunk.  I've asked about backporting it to 2.21.
Comment 7 Sourceware Commits 2011-05-15 19:04:23 UTC
CVSROOT:	/cvs/src
Module name:	src
Branch: 	binutils-2_21-branch
Changes by:	rsandifo@sourceware.org	2011-05-15 19:04:20

Modified files:
	bfd            : elfxx-mips.c ChangeLog 

Log message:
	bfd/
	PR ld/12637
	* elfxx-mips.c (mips_elf_merge_got_with): Use arg->global_count
	as the number of global entries when merging with the primary GOT.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elfxx-mips.c.diff?cvsroot=src&only_with_tag=binutils-2_21-branch&r1=1.279.2.1&r2=1.279.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_21-branch&r1=1.5180.2.30&r2=1.5180.2.31
Comment 8 rsandifo@nildram.co.uk 2011-05-15 19:10:02 UTC
Fixed on trunk and branch.
Comment 9 Jackie Rosen 2014-02-16 17:45:26 UTC Comment hidden (spam)
Comment 10 namboru 2021-09-15 02:39:58 UTC Comment hidden (spam)