Re: Help: build failure due to relocation truncated to fit: R_MIPS_GOT16 and others

"Steve M. Robbins" <[email protected]>
Newsgroups gmane.linux.debian.ports.mips
Message-ID <1572167.MFRMKHYAFJ@riemann>
Thank you James!

On Sunday, November 20, 2016 7:05:28 PM CST James Cowgill wrote:

> These relocation errors mean you have too many symbols in the GOT in
> your executable. MIPS usually uses a single instruction to access the
> GOT, but that only works for small GOTs. If your GOT is too large, it's
> still possible to make it work using -mxgot, but it takes 3 instructions
> to load a 32-bit address, add to the gp register, and do the final load.
> Since you don't know how the linker will allocate the GOT, you have to
> use -mxgot on all C/C++ files. The penalty occurs when you access any
> non-static global functions/variables.

OK, great!  So just to be certain: it is sufficient to use -mxgot on the project 
being compiled?  I don't have to worry about the various libraries pulled in?

> Your options are: reduce the number of symbols which span across
> translation unit boundaries (thus reducing the size of the GOT), or
> compile with -mxgot on MIPS with a slight speed penalty.

In this case: it is a test suite, so I expect the speed penalty is acceptable.

Thanks,
-Steve
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEy89k8fa3rclNjyokyeVeL63I9LkFAlgyAL8ACgkQyeVeL63I
9LlTgQ/7BdgsQc9h+TV94P0q0ZT1R+lvvSxrTltGxv+x52yKliXdVJUot7tLqdpI
hUz98LWAX4X1Mo53DALVIWUuTFGyQHoVHXq6VixZHy2jcmIaKJCJTiGEvH5wWRbk
7QSZw16kqFSeoH0g3aKMNbF8QYCxKEyNfMR/HOvJYQmqhI0QMI3Jw22M0KyhAzh4
89hiSkSabFIFl3AD4fa3krYPqI2+xVsDPm3ioxP9BjNfj/Fc3N9YUV0OJxE74E77
FabkNlaZLcGphxDnwBd+f5mi6XGhChs00BxBFtmNVQPUqIx/T+Tcq+pKOpOIQ/Fr
7R8/tqJBgMhXQ8reZI72PDFpsY5d4x4spwON0erzZ5aczC3FOtazcd59hmtmF/Jb
8SbJEQRK+gXnUdlcAK6Tf7MZ1j06pNdbm3L6XPJ2dbug1DF6hfdIGfe9rg4o+wQT
ASKOWbWuilPjbklJ0itM4NjiVpCJRrTPpQr3rBx3/zKrIxYwPPYThe2niqVk/e5q
A9VfWLFeUZtC7QC3MzOyKP0POOajf1Fs5U5ACsnojnlFdEC9TvEvVSQADHWECXyb
MbtQ2C/UadXyaJ0WACD20UE6wIJFCepsmLyTlW8zM6kMduEInVlp2Q7Oa/iwl95Q
MLgWrUM7T145BBdyrHYS1KEZ95ajCBTLtBNsHzr2mW2XXZbXe7A=
=0QmD
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.