This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

R_PPC_EMB_SDA21 relocation


Hi,

I'm getting an R_PPC_EMB_SDA21 relocation is in the wrong output section
error with the following testcase on powerpc targetted gcc 3.4.0 when using
the -msdata=eabi switch.

I've attached pre-processed source & assembly output.

Is this a bug or am I missing something?

typedef void (*Callback)(int);

Callback SetCallback(Callback callback)
{
	return callback;
}

static void testCB(int count)
{
	int i;
	for (i=0; i<count;i++);
}

int main()
{
	SetCallback(testCB);
}


davem@NEUROMANCER /c/projects/gamecube/test
$ powerpc-elf-gcc  -c -meabi -msdata test.c

davem@NEUROMANCER /c/projects/gamecube/test
$ powerpc-elf-gcc  -meabi -msdata test.o
c:\devkitPPC_r7a\bin\..\lib\gcc\powerpc-elf\3.4.0\..\..\..\..\powerpc-elf\bi
n\ld.exe: warning: cannot find entry symbol _start
; defaulting to 01800074
c:\devkitPPC_r7a\bin\..\lib\gcc\powerpc-elf\3.4.0\..\..\..\..\powerpc-elf\bi
n\ld.exe: test.o: the target (testCB) of a R_PPC_EMB_SDA21 relocation is in
the wrong output section (.text)
c:\devkitPPC_r7a\bin\..\lib\gcc\powerpc-elf\3.4.0\..\..\..\..\powerpc-elf\bi
n\ld.exe: final link failed: Bad value
collect2: ld returned 1 exit status

davem@NEUROMANCER /c/projects/gamecube/test
$ powerpc-elf-gcc -v
Reading specs from c:/devkitPPC_r7a/bin/../lib/gcc/powerpc-elf/3.4.0/specs
Configured with:
../../gcc-3.4.0//configure --enable-languages=c,c++ --with-cpu=750 --with-gc
c --with-gnu-ld --with-gnu-as --with-stabs --disable-nls --disable-shared --
disable-threads --disable-multilib --disable-win32-registry --target=powerpc
-elf --
with-newlib --prefix=c:/devkitPPC_r7a -v
Thread model: single
gcc version 3.4.0 (mingw special)

davem@NEUROMANCER /c/projects/gamecube/test
$ powerpc-elf-ld --version
GNU ld version 2.15
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.

Attachment: test.i
Description: Binary data

Attachment: test.s
Description: Binary data


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