This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Smpeg MMX asm compilation (problem)
Matt wrote:
Alright, I've managed to get both .S files to compile- however when I
try to link them with a program using:
extern "C" {
extern unsigned int cpu_flags(void);
extern void IDCT_mmx(DCTBLOCK data);
}
The linker tool comes up with
./.libs/libsmpeg.a(parseblock.o): In function `Z8InitIDCTv':
e:/programming/smpeg/video/parseblock.cpp:117: undefined reference to
`cpu_flags()'
./.libs/libsmpeg.a(parseblock.o): In function
`Z15ParseReconBlockiP10vid_stream':
e:/programming/smpeg/video/parseblock.cpp:583: undefined reference to
`IDCT_mmx(short*)'
They *are* getting assembled&linked- Why is this??
Here's the code for the mmxflags_asm.S, which should be enough for you
folk to figure it out:
"
.text
.align 2
.globl cpu_flags
.def cpu_flags; .scl 2; .type 32; .endef
cpu_flags:
cpu_flags.L1:
ret
"
M@
http://www.google.com/search?&q=mixing+assembly+and+c
8.2.2 Using C Functions in Assembly Procedures
should give you a hint...
Cheers,
Pedro Alves