2011-10-20 06:40:40     undefined reference to `Ret_Add'

Document created by Aaronwu Employee on Aug 28, 2013
Version 1Show Document
  • View in full screen mode

2011-10-20 06:40:40     undefined reference to `Ret_Add'

william pagnon (AUSTRALIA)

Message: 104043   

 

Hi,

 

 

 

I don't know where this linking error come from:

 

 

 

make

bfin-elf-gcc -g -mcpu=bf561 -mmulticore -mcoreb -mlong-calls -Wall -save-temps -I/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/../../include -I/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/../../../../../linux-2.6.x/include -I/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/../../../../../linux-2.6.x/arch/blackfin/include -I/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/../../../../../linux-2.6.x/arch/blackfin/include/generated -I/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/../../../../../linux-2.6.x/arch/blackfin/mach-bf561/include  -I/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/../../../../../linux-2.6.x/drivers/staging/icc/include -I/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/include -I/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/Source/portable/ADI_VDSP/Blackfin -I/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/Source/include -I/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/BF561 -I/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/../../../../../linux-2.6.x/arch/blackfin/include/asm -I/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/CFFT_Rad4_NS_NBRev/corea  -DCONFIG_BF561 -D__KERNEL__ -O3  -c  test_ad1836_driver.c   /home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/Source/portable/ADI_VDSP/Blackfin/port.c /home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/Source/include/../tasks.c /home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/Source/include/../queue.c /home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/Source/include/../croutine.c /home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/Source/include/../portable/MemMang/heap_2.c  /home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/Source/include/../list.c /home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/BF561/app_c.c  /home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/BF561/ezkit_561.c  -x assembler-with-cpp /home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/CFFT_Rad4_NS_NBRev/corea/cycle_count.asm /home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/Source/portable/ADI_VDSP/Blackfin/context_sl_asm.asm /home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/Source/portable/ADI_VDSP/Blackfin/bfin_isr.s /home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/BF561/user_isr.asm  /home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/CFFT_Rad4_NS_NBRev/corea/CFFT_Rad4_NS_NBRev.asm

In file included from test_ad1836_driver.c:14:

Initialize.c:58: warning: initialisation makes pointer from integer without a cast

test_ad1836_driver.c:33: warning: type defaults to ‘int’ in declaration of ‘sm_recv_packet’

test_ad1836_driver.c:106: warning: initialisation makes pointer from integer without a cast

test_ad1836_driver.c:109: warning: initialisation makes pointer from integer without a cast

test_ad1836_driver.c:112: warning: initialisation makes pointer from integer without a cast

test_ad1836_driver.c:115: warning: initialisation makes pointer from integer without a cast

test_ad1836_driver.c:118: warning: initialisation makes pointer from integer without a cast

test_ad1836_driver.c:121: warning: initialisation makes pointer from integer without a cast

test_ad1836_driver.c: In function ‘prvSetupTimerInterrupt’:

test_ad1836_driver.c:182: warning: assignment makes pointer from integer without a cast

test_ad1836_driver.c: In function ‘icc_task_init’:

test_ad1836_driver.c:518: warning: initialisation from incompatible pointer type

test_ad1836_driver.c:713: warning: passing argument 5 of ‘sm_recv_packet’ makes pointer from integer without a cast

test_ad1836_driver.c: In function ‘Init_Sport_Interrupts’:

Initialize.c:264: warning: ‘i’ is used uninitialized in this function

bfin-elf-ld -v  -o test_ad1836_driver -T  coreb_test_ad1836_driver.lds  --just-symbol ../../icc_core/icc queue.o ezkit_561.o  heap_2.o  port.o tasks.o test_ad1836_driver.o list.o croutine.o user_isr.o bfin_isr.o app_c.o context_sl_asm.o cycle_count.o CFFT_Rad4_NS_NBRev.o -Ttext 0x3c00000 -L /opt/uClinux/bfin-elf/bfin-elf/lib -L /opt/uClinux/bfin-elf/bfin-elf/lib -lc

argv[0]      = 'bfin-elf-ld'

bindir       = '/opt/uClinux/bfin-elf/bin/'

tooldir      = '/opt/uClinux/bfin-elf/bin/../bfin-elf/bin/'

linker       = '/opt/uClinux/bfin-elf/bin/../bfin-elf/bin/ld.real'

elf2flt      = '/opt/uClinux/bfin-elf/bin/../bfin-elf/bin/elf2flt'

nm           = '/opt/uClinux/bfin-elf/bin/../bfin-elf/bin/nm'

objdump      = '/opt/uClinux/bfin-elf/bin/bfin-elf-objdump'

objcopy      = '/opt/uClinux/bfin-elf/bin/bfin-elf-objcopy'

ldscriptpath = '/opt/uClinux/bfin-elf/bin/../bfin-elf/bin/../lib'

Invoking: '/opt/uClinux/bfin-elf/bin/../bfin-elf/bin/ld.real' '-v' '-o' 'test_ad1836_driver' '-T' 'coreb_test_ad1836_driver.lds' '--just-symbol' '../../icc_core/icc' 'queue.o' 'ezkit_561.o' 'heap_2.o' 'port.o' 'tasks.o' 'test_ad1836_driver.o' 'list.o' 'croutine.o' 'user_isr.o' 'bfin_isr.o' 'app_c.o' 'context_sl_asm.o' 'cycle_count.o' 'CFFT_Rad4_NS_NBRev.o' '-Ttext' '0x3c00000' '-L' '/opt/uClinux/bfin-elf/bfin-elf/lib' '-L' '/opt/uClinux/bfin-elf/bfin-elf/lib' '-lc'

GNU ld version 2.17

cycle_count.o: In function `Compute_Cycle_Count':

/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/CFFT_Rad4_NS_NBRev/corea/cycle_count.asm:22: undefined reference to `Ret_Add'

/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/CFFT_Rad4_NS_NBRev/corea/cycle_count.asm:23: undefined reference to `Ret_Add'

/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/CFFT_Rad4_NS_NBRev/corea/cycle_count.asm:27: undefined reference to `Save_R7'

/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/CFFT_Rad4_NS_NBRev/corea/cycle_count.asm:28: undefined reference to `Save_R7'

/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/CFFT_Rad4_NS_NBRev/corea/cycle_count.asm:44: undefined reference to `Save_R7'

/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/CFFT_Rad4_NS_NBRev/corea/cycle_count.asm:45: undefined reference to `Save_R7'

/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/CFFT_Rad4_NS_NBRev/corea/cycle_count.asm:48: undefined reference to `Ret_Add'

/home/william/Development_new/Music_Recognition/code/uCLinux/uclinux-dist/user/blkfin-apps/icc_utils/example/DSP_imp/CFFT_Rad4_NS_NBRev/corea/cycle_count.asm:49: undefined reference to `Ret_Add'

make: *** [test_ad1836_driver] Error 1

 

 

in the code cycle_count.asm that I convert to bare metal application I've got:

 

.....

 

.section l1.data;                                                             

.align 4;                                                                     

        .var _Ret_Add ;                                                       

        .var _Save_R7 ;                                                       

 

.section l1.text;                                                             

.global _Compute_Cycle_Count;                                                 

.align 8;                                                                     

_Compute_Cycle_Count:

        P0.L = _Ret_Add;                                                      

        P0.H = _Ret_Add;                                                      

        R3 = RETS;                                                            

        [P0] = R3;                                                            

 

        P0.L = _Save_R7;                                                      

        P0.H = _Save_R7;                                                      

        [P0] = R7;                                                            

.......

 

 

 

So it seem to be define and in section l1.data which in the lds file. I attache the lds file in case there a memory problem.

 

 

I'm implementing this in core b of BF561 by the way and this code is the conversion of VDSP FFT optimisation code to bare metal.

 

 

 

Best Regards,

 

William

 

coreb_test_ad1836_driver.lds

Outcomes