This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Question on PowerPC relocation error
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 08 Feb 2004 14:23:42 -0800
- Subject: Re: Question on PowerPC relocation error
- References: <4026624E.2050403@oarcorp.com>
Joel Sherrill <joel.sherrill@oarcorp.com> writes:
> Hi,
>
> We are getting this error from a couple of lines in the RTEMS PowerPC
> exception vector code:
>
> .../ld: ../../../../../mvme2307/lib/librtemsbsp.a(vectors.rel): the
> target (globalExceptHdl) of a R_PPC_EMB_SDA21 relocation is in the
> wrong output section (.bss)
>
> The assembly code in question is:
>
> .text
> ...
> addis r4, 0, globalExceptHdl@ha
> lwz r5, globalExceptHdl@l(r4)
>
> where globalExceptHdl is declared in C as
>
> typedef void (*exception_handler_t) (BSP_Exception_frame* excPtr);
> exception_handler_t globalExceptHdl;
>
> I tried looking at the assembly output of comparable C and the same
> code in other board support
> packages but I can't spot any differences. What does this error mean
> and what am I looking for
> as a mistake?
It means that either you should be referencing the variable indirectly,
or the variable should be in .sbss not .bss, which would typically mean
that you're passing the wrong -G option to either the compiler or the linker.
--
- Geoffrey Keating <geoffk@geoffk.org>