[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

assembler compiling



Hi,
 
We have an application with ET100LX and we have following software problem.
We have developed our own graphical library which uses some assembler code (engine.asm).
The assembler (engine.asm) defines global functions with underscore prefixed:
 
...
    .global _draw_point
...
_draw_point:
    PUSH    SRP
    MOVE.D  R10,[oldx]
    MOVE.D  R11,[oldy]
    CMP.D   [_clip_x_min],R10
...
 
The assembler functions are  declared in base.h and used in base.cpp.
 
base.h:
...
void draw_point(int x, int y) asm("_draw_point");
...
// this line force linker to linking with fgl.lib implicitly
#pragma aux draw_point "_*"
...
 
base.cpp:
...
draw_point(xs+x, ys+y);
...
 
To compile engine.asm we use as-cris engine.asm -o engine.o.
The graphical library is compiled without errors into libfgl.a.
 
The problem begins when compiling an application (testfastgl), which is using this library.
Following message displays:
 
bash-2.03# make
g++-cris -mlinux -xc++ -isystem /opt/axis/dr1a_lx_20/eroot/include -Wall -O2 -Wno-ctor-dtor-privacy -ansi -pipe -c -o testfastgl.o testfastgl.cpp
gcc-cris -mlinux -isystem /opt/axis/dr1a_lx_20/eroot/include -s -L/opt/axis/dr1a_lx_20/eroot/lib -s -fPIC testfastgl.o -lfgl -ldl -lstdc++ -o testfastgl
/usr/local/cris/lib/gcc-lib/cris/2.96/rld-cris: engine.o: uses _-prefixed symbols, but writing file with non-prefixed symbols
Bad value: failed to merge target specific data of file /opt/axis/dr1a_lx_20/eroot/lib/libfgl.a(engine.o)
collect2: ld returned 1 exit status
make: *** [testfastgl] Error 1
 
When we displayed information about engine.o file (using cris-objdump -x engine.o), following message was displayed:
 
engine.o: file format elf32-us-cris
engine.o
architecture: cris, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x00000000
private flags = 1: [symbols have a _ prefix]
...
 
We think that the last line is important, because other .o files have private flags = 0.
 
Can anybody help us?
 
Best regards,
 
Petr Hanyk