This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
? about calling a gas function from a C file
- From: Brad Walker <bwalker at musings dot com>
- To: binutils at sourceware dot org
- Date: Fri, 2 Jul 2010 10:48:46 -0600
- Subject: ? 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.