"Error: unsupported relocation against <register>" error with inline PPC assembly code in .c file

I have below inline assembly code. But when i try to compile it, It throws error mentioned after the code snippet.

unsigned int func(void)
{
  __asm__ ("mfspr r3, svr;");
}

Below are the errors.

{standard input}: Assembler messages:
{standard input}:3349: Error: unsupported relocation against r3
{standard input}:3349: Error: unsupported relocation against svr
{standard input}:3375: Error: unsupported relocation against r3
{standard input}:3375: Error: unsupported relocation against svr
{standard input}:3510: Error: unsupported relocation against r3
{standard input}:3510: Error: unsupported relocation against svr
{standard input}:3517: Error: unsupported relocation against r3
{standard input}:3517: Error: unsupported relocation against svr

Can anyone help me fixing these?


Source: gcc

Leave a Reply