This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Why relocation truncated to fit: R_MIPS_26 again `memcpy'?


Hi Nick,

Nick Clifton <nickc@redhat.com> writes:

> Hi Pan,
>
>> test.c:(.text+0x64): relocation truncated to fit: R_MIPS_26 against `memcpy'
>
>> 80000628 T memcpy
>
>> Since .text section and memcpy are located in the same 256M region,
>> how the `relocation truncated to fit' linking error comes?
>
> The R_MIPS_26 relocation is not PC-relative.  Therefore it is trying to put
> the address of the memcpy symbol into a 26-bit wide field.  Since the address
> is 0x80000628 the value will not fit and you get the error message above.

It is PC-relative, in terms of the current 256M segment the relocation
(i.e. the direct jump instruction) is in.

Adam


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]