This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

? about calling a gas function from a C file


I'm porting some code in an embedded environment and I have a problem.

I have a .s file that looks like this:

file.s
------

        .globl  dcache_enable
dcache_enable:
         .....


file.c
------

extern void dcache_enable(void);

main()
{
  if (TRUE)
    dcache_enable();

   ...

}

This is overly simplified code just to show what I'm trying to do.
Compiling the file.s with gas works. Compiling the C file with gcc
works

But, my problem is when I link with ld I get "mulitple definitions of symbol"..

Any ideas about how to properly declare this? Maybe an example of
calling an assembler function from a C file would help me..

Thanks for any help you can provide.

-brad w.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]