GCC-3.4.0 on FRV architecture BUG report
zhanrk
zhanrk-gcc@163.com
Mon May 17 10:38:00 GMT 2004
> zhanrk wrote:
> > /*
> > * BUG ?!
> > * It should be "call 00000110 <puts>"
> > */
> > 288: fe 3f ff 5e call 0 <flush_input>
>
> Not necessarily. There is probably a relocation for this address that
> will insert the address of the puts function. Try using "objdump -x"
> and look at the list of relocations. There should be one for the
> address 0x288 that contains the value of puts.
>
> Reading disassembled assembler output can be confusing if you don't know
> how assemblers and linkers work. Try looking at the compiler -S output.
> Also, this does not prove a compiler problem, as this could be an
> assembler bug. That is another reason to look at the compiler -S output.
> --
> Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
>
>
hi, Jim. thanks a lot for your answer.
And I have follow your advice, which proves that it is a gas BUG.
I use the following command to generate the assembly output:
frv-elf-gcc -S -nostdinc -I /root/openboot/include -Wall -fomit-frame-pointer
-fno-builtin -mcpu=fr400 -mno-vliw-branch stdio.c -o stdio.S
assembly result:
.text
.p2align 4
.globl printf
.type printf, @function
printf:
addi sp,#-56,sp
sti fp, @(sp,16)
addi sp,#16,fp
movsg lr, gr5
sti gr5, @(fp,8)
stdi gr8, @(fp,16)
stdi gr10, @(fp,24)
stdi gr12, @(fp,32)
# blockage
sti gr8, @(fp,-4)
sethi #hi(printbuffer), gr8
setlo #lo(printbuffer), gr8
setlos #0, gr9
setlos #512, gr10
call memset
addi fp,#40,gr4
addi gr4,#-20,gr4
sti gr4, @(fp,-8)
sethi #hi(printbuffer), gr8
setlo #lo(printbuffer), gr8
ldi @(fp,-4), gr9
ldi @(fp,-8), gr10
call vsprintf
mov gr8, gr4
sthi gr4, @(fp,-10)
sethi #hi(printbuffer), gr8
setlo #lo(printbuffer), gr8
/*
* It is correct.
*/
call puts
ldi @(fp,8), gr5
ld @(fp,gr0), fp
addi sp,#56,sp
jmpl @(gr5,gr0)
========================================================
çÂÂæÂÂ
Ã¥ÂÂ馠è¶Â
å¼ä¼ÂæÂ VIPé®箱买ä¸ÂéÂÂå 买ä¸ÂéÂÂÃ¥ÂÂäºÂï¼ http://vip.163.com
ä¸Â彿ÂÂ大çÂÂÃ¥Â
Âè´¹é®箱å¨çÂÂä½ 25Ã¥Â
Â空é´4Ã¥Â
ÂéÂÂä»¶ï¼ÂãÂÂãÂÂãÂÂãÂÂã http://mail.163.com
ç¹å»ç½ÂæÂÂ泡泡æÂÂÃ¥ÂÂæÂ é åÂ
¨åÂ
Âè´¹æÂÂæÂºçÂÂ信任你åÂÂ!ãÂÂãÂÂãÂÂã http://popo.163.com
More information about the Gcc
mailing list