2008-05-16 09:01:04     problem using arg_fr16

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

2008-05-16 09:01:04     problem using arg_fr16

Michael Goodwin (UNITED STATES)

Message: 55926   

 

Hi,

 

When trying to use the arg_fr16( )  function I received the following error messages.

 

I'm using blackfin-toolchain-08r1-8 and uClinux-dist-2008R1-RC2.

 

The following code snippet was cut out of an application (fir.c) that compiled and ran cleanly before adding the arg_fr16() function. Running "file" on fir (without arg_fr16()) returned:

 

fir: ELF 32-bit LSB executable, Analog Devices Blackfin, version 1 (SYSV), dynamically linked (uses shared libs), not stripped

 

I added #include <math_bf.h> to the snippet with the same result.

 

However, with #include <math_bf.h> and using atan2_fr16() instead of arg_fr16() the snippet compiled (with a warning about referencing a different segment) and ran correctly.

 

When I did the same to fir.c, the program compiled (with the same warning about referencing a different segment) but when run issued the following error:

 

root:/bin> ./fir

Unable to load executable

SIGSEGV

 

Am I missing another header file?

 

Thanks,

 

Mike

 

-----------------------------------------------------

Excerpt from Makefile (based on Makefile in user/blkfin-test/audio_test)

 

arg_test: arg_test.c

    $(CC) $(CFLAGS) $(LDFLAGS) -o $@ arg_test.c -lm -lbfdsp  $(LDLIBS)

 

fir: fir.c

    $(CC) $(CFLAGS) -Wl,--data-in-l1 $(LDFLAGS) -o $@ fir.c -lm -lbfdsp  $(LDLIBS)

-----------------------------------------------------

 

#include <asm/ioctl.h>

#include <unistd.h>

#include <fcntl.h>

#include <sys/soundcard.h>

#include <sys/ioctl.h>

 

#include <stdio.h>

#include <stdlib.h>

 

#include <filter.h>

 

//#include <math_bf.h>

#include <fract.h>

#include <math.h>

#include <complex.h>

 

int main( void )

{

 

fract16 phase;

complex_fract16 iq_num;

 

 

        iq_num.re = 0x7000;

        iq_num.im = 0x7000;

 

              phase = 0;

        phase = arg_fr16( iq_num );

//      phase = atan2_fr16( iq_num.re, iq_num.im );

        printf("phase = %d\n", phase );

 

        return(1);

}

 

-----------------------------------------------------------------------

mike@mike-desktop:~/uClinux/uClinux-dist$ make

user/blkfin-test/audio_test_only

make[1]: Entering directory `/home/mike/uClinux/uClinux-dist/user'

touch blkfin-test/audio_test/.sgbuilt_user && make -j1 -C

blkfin-test/audio_test

make[2]: Entering directory

`/home/mike/uClinux/uClinux-dist/user/blkfin-test/audio_test'

bfin-linux-uclibc-gcc -pipe -Wall -g -O2        -mcpu=bf537-0.2

-mcpu=bf537-0.2 -o arg_test arg_test.c -lm -lbfdsp

/home/mike/uClinux/toolchain/bfin-linux-uclibc/bfin-linux-uclibc/runtime/bf532-0.3/usr/lib/libbfdsp.a(arg16.o): In function `__arg_fr16':

arg16.c:(.text+0x20): undefined reference to `_multr_fr1x16'

arg16.c:(.text+0x38): undefined reference to `_multr_fr1x16'

/home/mike/uClinux/toolchain/bfin-linux-uclibc/bfin-linux-uclibc/runtime/bf532-0.3/usr/lib/libbfdsp.a(atan2_fr16.o): In function `__atan2_fr16':

atan2_fr16.asm:(.text+0x34): warning: warning: relocation references a different segment

atan2_fr16.asm:(.text+0x38): warning: warning: relocation references a different segment

collect2: ld returned 1 exit status

make[2]: *** [arg_test] Error 1

make[2]: Leaving directory

`/home/mike/uClinux/uClinux-dist/user/blkfin-test/audio_test'

make[1]: *** [blkfin-test/audio_test_only] Error 2

make[1]: Leaving directory `/home/mike/uClinux/uClinux-dist/user'

make: *** [user/blkfin-test/audio_test_only] Error 2

mike@mike-desktop:~/uClinux/uClinux-dist$

QuoteReplyEditDelete

 

 

2008-05-16 10:47:55     Re: problem using arg_fr16

Mike Frysinger (UNITED STATES)

Message: 55933   

 

looks like two different problems there ... first is that the multr_fr1x16 symbol doesnt exist ... second is that the relocation errors indicate FDPIC support missing

 

ive opened a bug in our tracker:

http://blackfin.uclinux.org/gf/project/toolchain/tracker/?action=TrackerItemEdit&tracker_item_id=4110

Attachments

    Outcomes