Skip to contentSkip to conversation

eldk bug?how to fix

DISCUSSION [email protected] 4 participants 6 messages Dec 18, 2005 – Feb 9, 2006

lore
Share & tools
lore
#0 lore raw

[root@localhost atmlz]# ppc_6xx-gcc -c -o temp atm_aalx.c atm_aalx.c: In function `main':
atm_aalx.c:201: warning: return type of main' is not int' /tmp/cciJlehe.s: Assembler messages:
/tmp/cciJlehe.s:916: Error: unsupported relocation against r3 /tmp/cciJlehe.s:917: Error: unsupported relocation against r3 /tmp/cciJlehe.s:917: Error: unsupported relocation against r3 /tmp/cciJlehe.s:918: Error: unsupported relocation against r3 /tmp/cciJlehe.s:918: Error: unsupported relocation against r3 /tmp/cciJlehe.s:919: Error: unsupported relocation against r3 /tmp/cciJlehe.s:3655: Error: unsupported relocation against r3 [root@localhost atmlz]# ppc_6xx-gcc -S -o temp.s atm_aalx.c [root@localhost atmlz]# vi temp.s
...................

        stw 0,4(9)                 
.L36:                              
#APP                               
         mfmsr r3                  
         ori r3,r3,0x8000          
         andi. r3,r3,0xffbf        
         mtmsr r3                  
#NO_APP                            
        lwz 11,0(1)                

..............................
I must change those "r3" to "3" manually.
How to fix?

------------------------------
我现在使用Sogou.com的2G邮箱了,你也来试试吧!
http://mail.sogou.com/recommend/sogoumail_invite_reg1.jsp?from=sogouinvitation&s_EMAIL=zengshuai%40sogou.com&username=linuxppc-embedded&FullName=linuxppc-embedded&Email=linuxppc-embedded%40ozlabs.org&verify=755eff4e640bdcfc57d93cbd8b0a9cb7

#1 lore raw
Quoted 11 lines · In message <[email protected]> you wrote:

[root@localhost atmlz]# ppc_6xx-gcc -c -o temp atm_aalx.c atm_aalx.c: In function `main':
atm_aalx.c:201: warning: return type of main' is not int' /tmp/cciJlehe.s: Assembler messages:
/tmp/cciJlehe.s:916: Error: unsupported relocation against r3 /tmp/cciJlehe.s:917: Error: unsupported relocation against r3 /tmp/cciJlehe.s:917: Error: unsupported relocation against r3 /tmp/cciJlehe.s:918: Error: unsupported relocation against r3 /tmp/cciJlehe.s:918: Error: unsupported relocation against r3 /tmp/cciJlehe.s:919: Error: unsupported relocation against r3 /tmp/cciJlehe.s:3655: Error: unsupported relocation against r3

Are you by any chance using inline assembler code in your source file? This is the only explanation I have, since GCC does not generate "r3" references in it's assembler code.

It would have been a good idea if you had included your source code so we could see what you are doing...

Quoted 12 lines

[root@localhost atmlz]# ppc_6xx-gcc -S -o temp.s atm_aalx.c [root@localhost atmlz]# vi temp.s
...................

        stw 0,4(9)                 
.L36:                              
#APP                               
         mfmsr r3                  
         ori r3,r3,0x8000          
         andi. r3,r3,0xffbf        
         mtmsr r3                  
#NO_APP                            
        lwz 11,0(1)                
Quoted 1 line

..............................

I see. This is your own assembler code, not something generated from C source code.

Quoted 2 lines

I must change those "r3" to "3" manually.
How to fix?

Don't write incorrect assembler code, or use the required header files (like ppc_asm.tmpl).

And while we are at it: be careful not to try privileged instructions in user space.

This is your own error, not a problem with ELDK.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
If I had to live my life again,  I'd  make  the  same  mistakes, only
sooner.                                          -- Tallulah Bankhead
#2 lore raw
In reply to [email protected]

Hmm...
I've seen these messages before. They were gone when I compiled using ppc_8xx-gcc compiler of a different ELDK version.
What version of ELDK are you using? Which gcc version?

Succes,
Theo Gjaltema.

[email protected] schreef:

Quoted 38 lines

[root@localhost atmlz]# ppc_6xx-gcc -c -o temp atm_aalx.c atm_aalx.c: In function `main':
atm_aalx.c:201: warning: return type of main' is not int' /tmp/cciJlehe.s: Assembler messages:
/tmp/cciJlehe.s:916: Error: unsupported relocation against r3 /tmp/cciJlehe.s:917: Error: unsupported relocation against r3 /tmp/cciJlehe.s:917: Error: unsupported relocation against r3 /tmp/cciJlehe.s:918: Error: unsupported relocation against r3 /tmp/cciJlehe.s:918: Error: unsupported relocation against r3 /tmp/cciJlehe.s:919: Error: unsupported relocation against r3 /tmp/cciJlehe.s:3655: Error: unsupported relocation against r3 [root@localhost atmlz]# ppc_6xx-gcc -S -o temp.s atm_aalx.c [root@localhost atmlz]# vi temp.s
...................

       stw 0,4(9)                 
.L36:                              
#APP                               
        mfmsr r3                  
        ori r3,r3,0x8000          
        andi. r3,r3,0xffbf        
        mtmsr r3                  
#NO_APP                            
       lwz 11,0(1)                

..............................
I must change those "r3" to "3" manually.
How to fix?

------------------------------
我现在使用Sogou.com的2G邮箱了,你也来试试吧!
http://mail.sogou.com/recommend/sogoumail_invite_reg1.jsp?from=sogouinvitation&s_EMAIL=zengshuai%40sogou.com&username=linuxppc-embedded&FullName=linuxppc-embedded&Email=linuxppc-embedded%40ozlabs.org&verify=755eff4e640bdcfc57d93cbd8b0a9cb7

_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

#3 lore raw
Quoted 4 lines · In message <[email protected]> you wrote:

I've seen these messages before. They were gone when I compiled using ppc_8xx-gcc compiler of a different ELDK version.
What version of ELDK are you using? Which gcc version?

This has nothing to do with ELDK versions, or any other toolchain issues.

Quoted 5 lines
Quoted 5 lines

[root@localhost atmlz]# ppc_6xx-gcc -c -o temp atm_aalx.c atm_aalx.c: In function `main':
atm_aalx.c:201: warning: return type of main' is not int' /tmp/cciJlehe.s: Assembler messages:
/tmp/cciJlehe.s:916: Error: unsupported relocation against r3

...

Quoted 4 lines
Quoted 4 lines
        mfmsr r3                  
        ori r3,r3,0x8000          
        andi. r3,r3,0xffbf        
        mtmsr r3                  

It's a user only problem (using symbolic names like "r3" in inline assember statements without incuding the proper header files to resolve thise names).

Best regards,

Wolfgang Denk

Signature · 5 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
We fight only when there is no other choice. We prefer  the  ways  of
peaceful contact.
	-- Kirk, "Spectre of the Gun", stardate 4385.3
#4 lore raw
In reply to Theo Gjaltema
Quoted 15 lines
Quoted 4 lines · In message <43B459C5.1060206 at chello.nl> you wrote:

I've seen these messages before. They were gone when I compiled > using ppc_8xx-gcc compiler of a different ELDK version.
What version of ELDK are you using? Which gcc version?

This has nothing to do with ELDK versions, or any other toolchain issues.

Quoted 5 lines
Quoted 5 lines

[root at localhost atmlz]# ppc_6xx-gcc -c -o temp atm_aalx.c atm_aalx.c: In function `main':
atm_aalx.c:201: warning: return type of main' is not int' /tmp/cciJlehe.s: Assembler messages:
/tmp/cciJlehe.s:916: Error: unsupported relocation against r3

...

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
        mfmsr r3
        ori r3,r3,0x8000
        andi. r3,r3,0xffbf
        mtmsr r3

It's a user only problem (using symbolic names like "r3" in inline assember statements without incuding the proper header files to resolve thise names).

I had that exact same problem, ESPECIALLY when pulling in a fresh kernel tree from kernel.org.

Fixed it by defining the CROSS_COMPILE environment variable or modifying the Makefile's CROSS_COMPILE to the correct file prefix name, in your case, it is probaly either

    # export CROSS_COMPILE=ppc_8xx-  (DENK gcc 3.3.3)
or
    # export CROSS_COMPILE=powerpc-linux-  (GNU gcc)

Check your PATH... make sure its picking up the right version...

  # whereis ppc_8xx-gcc
  # ppc_8xx-gcc --version
or
  # powerpc-linux-gcc --version

S. Egbert

#5 lore raw
Quoted 4 lines · In message <[email protected]> you wrote:
    # export CROSS_COMPILE=ppc_8xx-  (DENK gcc 3.3.3)
or
    # export CROSS_COMPILE=powerpc-linux-  (GNU gcc)

Ummm.... the compiler included with the ELDK is GNU gcc, too.

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
An expert is a person who avoids the small errors while  sweeping  on
to the grand fallacy.