2008-03-25 07:42:49     how to compile assembler file into a module

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

2008-03-25 07:42:49     how to compile assembler file into a module

sj tian (CHINA)

Message: 53009   

 

I write a char driver, there are two source files, sample_module.c and isr.s , in this driver moudle. But I can not compile this isr.s file.

 

error message : no rule to creat this object.

 

the content in my makefile file as following:

 

obj-m := sample_module.o

sample_module-objs := isr.o

 

 

 

these two files are saved in the same directory. and sample_module.h file announced the fonctions in the isr.s file.

 

If I did not add  isr.s in this driver, and cut "sample_module-objs := isr.o" in makefile, sample_module.c  and sample_module.h can compile.  but add isr.s flie , this driver module can not compile.

 

why? there is any question in my makefile? and I need modify other file in kernel? pls give me a hint.

 

Thanks alot!

QuoteReplyEditDelete

 

 

2008-03-25 23:30:01     Re: how to compile assembler file into a module

Mike Frysinger (UNITED STATES)

Message: 53025    try using isr.S

QuoteReplyEditDelete

 

 

2008-03-26 04:15:23     Re: how to compile assembler file into a module

sj tian (CHINA)

Message: 53032   

 

Thanks! That's ok.

 

There is another problem. I used a globle variable in a function of isr.S,. I defined this globle variable in sample_module.h file. and I anounced this globle variable with ".extern _Data_Offset;" at the start of isr.S. but  when compling,

 

the compilier  show  a warning:  _Data_Offset is undefined.

 

why?

QuoteReplyEditDelete

 

 

2008-03-26 10:08:16     Re: how to compile assembler file into a module

Mike Frysinger (UNITED STATES)

Message: 53057    post a build log rather than just a snippet

 

putting ".extern" in .S files doesnt really do anything as all symbols not defined are automatically assumed to be external

Attachments

    Outcomes