linux-mips
[Top] [All Lists]

Re: Link errors

To: martin.nichols@oxinst.co.uk
Subject: Re: Link errors
From: David Daney <ddaney@avtrex.com>
Date: Mon, 19 Jul 2004 09:43:47 -0700
Cc: linux-mips@linux-mips.org
In-reply-to: <DEF431FFDB15C1488464F0E57D5506642AA539@MEDNT02>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <DEF431FFDB15C1488464F0E57D5506642AA539@MEDNT02>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031030
martin.nichols@oxinst.co.uk wrote:
> Hi All,
> 
> I'm new to MIPs architecture and Linux so apologies in advance!
> 
> I'm trying to build an application to run on the Au1100.
> I have a crosscompiler setup (gcc 3.2) and can build a 'hello world' that
> runs on the target.
> When I try building a more serious application using Kdevelop - with the
> appropriate settings
> for the crosstools - I get lots of errors like this:
> assert.o(.text+0x1cc): relocation truncated to fit: R_MIPS_GOT16
> __assert_program_name
> /opt/crosstool/mipsel-unknown-linux-gnu/gcc-3.2.3-glibc-2.2.3/mipsel-unknown
> -linux-gnu/lib/libc.a(dcigettext.o): In function `_nl_find_msg':
> dcigettext.o(.text+0x153c): relocation truncated to fit: R_MIPS_CALL16
> _nl_load_domain
> /opt/crosstool/mipsel-unknown-linux-gnu/gcc-3.2.3-glibc-2.2.3/mipsel-unknown
> -linux-gnu/lib/libc.a(finddomain.o): In function `_nl_find_domain':
> 
> Could someone tell me what I'm doing wrong please.
> 
This is the got overflow problem.

Later versions of binutils have multi-got support (2.15 for example),
which under most circumstances will fix the problem.

If you have extreamly large compilation units you might have to use a
32bit got index.  In GCC3.4 and later this is done with the -mxgot
option.  With eariler versions of GCC you have to pass -xgot to the
assembler (-Wa,-xgot IIRC).

David Daney.


<Prev in Thread] Current Thread [Next in Thread>