Package: glibc,gcc Severity: important [I think this is the same issue as in bug #274738]
Trying to compile ghc6 on mipsel (all of this will apply equally to mips AFAIK) I got a number of "relocation truncated to fit" errors when linking the executable. After discussion with Thiemo Seufer I passed -Wa,-xgot to gcc, which fixes all the errors refering to my symbols, but I still got the errors below (partial output from passing the linker -dll-verbose). They refer to these files /usr/usr/lib/gcc-lib/mipsel-linux/3.3.4/../../../crt1.o /usr/lib/gcc-lib/mipsel-linux/3.3.4/libgcc.a /usr/lib/libc_nonshared.a (although presumably any other static libraries and object files that get pulled in may also need to be fixed too). As I understand it the files would need to be compiled both as they are now, and with the -Wa,-xgot flag to give e.g. crt1.xgot.o etc. gcc would then need to look for these files first when given an xgot flag of some sort. The aforementioned errors: attempt to open /usr/usr/lib/gcc-lib/mipsel-linux/3.3.4/../../../crt1.o(.text+0x1c):../sysdeps/mips/elf/start.S:71: relocation truncated to fit: R_MIPS_GOT16 main /usr/lib/gcc-lib/mipsel-linux/3.3.4/../../../crt1.o(.text+0x34):../sysdeps/mips/elf/start.S:83: relocation truncated to fit: R_MIPS_GOT16 __libc_csu_init /usr/lib/gcc-lib/mipsel-linux/3.3.4/../../../crt1.o(.text+0x38):../sysdeps/mips/elf/start.S:84: relocation truncated to fit: R_MIPS_GOT16 __libc_csu_fini /usr/lib/gcc-lib/mipsel-linux/3.3.4/../../../crt1.o(.text+0x4c):../sysdeps/mips/elf/start.S:93: relocation truncated to fit: R_MIPS_CALL16 __libc_start_main@@GLIBC_2.0 /usr/lib/gcc-lib/mipsel-linux/3.3.4/libgcc.a(_fixunsdfdi.oS)(.text+0x114): In function `__fixunsdfdi': : relocation truncated to fit: R_MIPS_CALL16 __floatdidf /usr/lib/gcc-lib/mipsel-linux/3.3.4/libgcc.a(_fixunsdfdi.oS)(.text+0x29c): In function `__fixunsdfdi': : relocation truncated to fit: R_MIPS_CALL16 __floatdidf /usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x28): In function `__libc_csu_init': : relocation truncated to fit: R_MIPS_CALL16 _init /usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x44): In function `__libc_csu_init': : relocation truncated to fit: R_MIPS_GOT16 __init_array_end /usr/lib/libc_nonshared.a(elf-init.oS)(.text+0xb4): In function `__libc_csu_fini': : relocation truncated to fit: R_MIPS_GOT16 __fini_array_start /usr/lib/libc_nonshared.a(elf-init.oS)(.text+0xb8): In function `__libc_csu_fini': : relocation truncated to fit: R_MIPS_GOT16 __fini_array_end /usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x114): In function `__libc_csu_fini': : relocation truncated to fit: R_MIPS_CALL16 _fini /lib/gcc-lib/mipsel-linux/3.3.4/../../../libc.so succeeded opened script file /usr/lib/gcc-lib/mipsel-linux/3.3.4/../../../libc.so Thanks Ian