2011-06-22 02:03:32     Porting asm code to GNU toolchain - unsupported relocation type 16 issue

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

2011-06-22 02:03:32     Porting asm code to GNU toolchain - unsupported relocation type 16 issue

John Peter (INDIA)

Message: 101529   

 

Hai,

 

              I am working for porting asm code to GNU toolchain compilation.During compilation, while accesing library file(libExtrac.a) i am facing issues like as mentioned below.

 

/opt/uClinux_2009R1_RC7/bfin-linux-uclibc/bin/../lib/gcc/bfin-linux-uclibc/4.1.2/../../../../bfin-linux-uclibc/bin/ld: libExtract.a (Extract.o): unsupported relocation type 16

 

 

libExtract.a: could not read symbols: Success

collect2: ld returned 1 exit status

 

Thanks

 

John

QuoteReplyEditDelete

 

 

2011-06-22 05:05:36     Re: Porting asm code to GNU toolchain - unsupported relocation type 16 issue

David Gibson (UNITED KINGDOM)

Message: 101562   

 

Hi,

 

could we get a bit more information on this issues please.

 

Is it possible for you to provide us with the source for Extract.o, or perhaps the library.

 

Could you also provide the command line you were using when you encountered the error?

 

Thanks,

 

David.

QuoteReplyEditDelete

 

 

2011-06-24 08:21:50     Re: Porting asm code to GNU toolchain - unsupported relocation type 16 issue

John Peter (INDIA)

Message: 101657   

 

Hi David,

 

                Thanks for your reply.We identified the root cause in library file  at variable declaration.I would like to know some clarification .

 

In Extract.h file :

 

.var _SyncWord

 

.global _SyncWord

 

this variable is shared by both asm (libExtract.a) and Main.c file.

 

During compilation, i am getting an error like "undefined reference to `_SyncWord' "

 

In VDSP platform we used to define buffer like  .int Framebuff[5], how to define the same in GNU (.S file) platform.

 

Thanks

 

John

QuoteReplyEditDelete

 

 

2011-06-24 08:56:49     Re: Porting asm code to GNU toolchain - unsupported relocation type 16 issue

Jie Zhang (UNITED STATES)

Message: 101659   

 

.comm  Framebuff,20,4

QuoteReplyEditDelete

 

 

2011-06-24 09:00:19     Re: Porting asm code to GNU toolchain - unsupported relocation type 16 issue

Peter Budny (UNITED STATES)

Message: 101660   

 

I'm not that familiar with VDSP, but... in normal C code, you would declare it exactly as written, with "int Framebuff[5];". In assembly, there is no concept of variables, only symbols that are assigned to memory locations. If you want to reserve space for it, you have to explicitly put it somewhere and specify how much space it takes up.

 

So, if your variable is declared in the C file, then you should just reference its symbol in assembly (probably as _Framebuff). If your variable is declared in assembly, you have to 1) reserve space for it, 2) declare the symbol as global, and 3) make the symbol available in C by declaring "extern int Framebuff[5];".

 

Header files probably shouldn't be shared between C files and assembly files because they have completely different syntax. It would only be okay if the only thing in your header files is preprocessor directives.

QuoteReplyEditDelete

 

 

2011-06-24 10:38:06     Re: Porting asm code to GNU toolchain - unsupported relocation type 16 issue

Mike Frysinger (UNITED STATES)

Message: 101662   

 

you didnt actually declare the symbol.  you have to use:

_SyncWord:

 

please read the documentation:

http://docs.blackfin.uclinux.org/doku.php?id=visualdsp:port_assembly_code&s[]=vdsp

QuoteReplyEditDelete

 

 

2011-06-27 05:35:14     Re: Porting asm code to GNU toolchain - unsupported relocation type 16 issue

John Peter (INDIA)

Message: 101707   

 

Hi,

 

Still I could not resolve my issue "undefined reference to `_SyncWord' ".

 

1).In Extract.h:

 

.var _SyncWord;  as per docs page (.int _SyncWord)

 

.global _SyncWord;

 

2). In Exract.S

 

p1.l=_SyncWord;

p1.h=_SyncWord;

 

3). In Main.c

 

extern .int SyncWord;

 

I tried to make these files to create an application executable file. It is not compilied successfully. Please clarify.

QuoteReplyEditDelete

 

 

2011-06-27 13:20:51     Re: Porting asm code to GNU toolchain - unsupported relocation type 16 issue

Mike Frysinger (UNITED STATES)

Message: 101715   

 

no where have you shown that you actually declared _SyncWord.  all three of those code snippets are *references*, not *definitions*.

 

please do as i already said and make sure you have a _SyncWord label somewhere.

Attachments

    Outcomes