Undefined reference | developer.brewmp.com Undefined reference | developer.brewmp.com

Developer

Undefined reference

Hello Friends,

I am trying to create a mod file for a game which has CPP files
I am using WinArm 4.1.1 version and latest BREWelf2mod
I am getting the following problems while creating mod file

undefined reference to '__modsi3'
undefined reference to '__divsi3'
undefined reference to '__umodsi3'

But all .o files are created successfully.

I created make file using Visual Studio add-ins and modified it.
I attached my Make file, please verify it and tell me where it needs to be modified

Thanks,
San

Can any one look into my problem?
Appreciate your help
Thanks,
San

Can any one look into my problem?
Appreciate your help
Thanks,
San

-lgcc should pull in __modsi3 etc. And it;s the last library in your link list, so should also be fine. Nonetheless I've only done a cursory scan of your makefile and you might try writing your libraries like this
-( -lm -lgcc -lmorelibs -)
so that the libraries are linked in one go rather than sequentially.

-lgcc should pull in __modsi3 etc. And it;s the last library in your link list, so should also be fine. Nonetheless I've only done a cursory scan of your makefile and you might try writing your libraries like this
-( -lm -lgcc -lmorelibs -)
so that the libraries are linked in one go rather than sequentially.

BenBlaukopf wrote:-lgcc should pull in __modsi3 etc. And it;s the last library in your link list, so should also be fine. Nonetheless I've only done a cursory scan of your makefile and you might try writing your libraries like this
-( -lm -lgcc -lmorelibs -)
so that the libraries are linked in one go rather than sequentially.
Thank you for your reply,
I tried by changing the libraries position like (-lm -lgcc -lmorelibs -)
But no progress
What could be the problem?
Thanks,
San

BenBlaukopf wrote:-lgcc should pull in __modsi3 etc. And it;s the last library in your link list, so should also be fine. Nonetheless I've only done a cursory scan of your makefile and you might try writing your libraries like this
-( -lm -lgcc -lmorelibs -)
so that the libraries are linked in one go rather than sequentially.
Thank you for your reply,
I tried by changing the libraries position like (-lm -lgcc -lmorelibs -)
But no progress
What could be the problem?
Thanks,
San

i have the same problem using GNUDE 3.3.1 and __modsi3 is defined in libgcc.a
strangely it is not seen by the linker
Is it hiding some _ prepend in the error msg ?
Anyone has a solution ?

i have the same problem using GNUDE 3.3.1 and __modsi3 is defined in libgcc.a
strangely it is not seen by the linker
Is it hiding some _ prepend in the error msg ?
Anyone has a solution ?

found!
source: http://brewforums.qualcomm.com/showthread.php?t=12074&page=2&pp=15&highl...
"Try moving the -lgcc to the _END_ of the linking statement:"
\winarm\bin\arm-elf-ld.exe ... AEEAppGen.o applet.o -lgcc

found!
source: http://brewforums.qualcomm.com/showthread.php?t=12074&page=2&pp=15&highl...
"Try moving the -lgcc to the _END_ of the linking statement:"
\winarm\bin\arm-elf-ld.exe ... AEEAppGen.o applet.o -lgcc

If you don't want to link with someone else's libraries and depending on your needs, you can write your own implementation of division.
__modsi3 = modulus 32bit integer division
__divsi3 = 32 bit integer division
__umodsi3 = 32 bit unsigned division...
Depending on the processor you are targeting there are two decent algorithms for this...
1) Restoring division
2) newton-raphson division
Restoring division with early termination is best for processors that do not have DSP extensions like the ARM 7 TDMI.
For processors such as the ARM 926EJ-S that have DSP extensions and/or in real-time environments where a constant time is needed, the newton-raphson with a initial look-up table is much faster. If done right, it can be as fast as ~30 cycles.
I hope this helps....

If you don't want to link with someone else's libraries and depending on your needs, you can write your own implementation of division.
__modsi3 = modulus 32bit integer division
__divsi3 = 32 bit integer division
__umodsi3 = 32 bit unsigned division...
Depending on the processor you are targeting there are two decent algorithms for this...
1) Restoring division
2) newton-raphson division
Restoring division with early termination is best for processors that do not have DSP extensions like the ARM 7 TDMI.
For processors such as the ARM 926EJ-S that have DSP extensions and/or in real-time environments where a constant time is needed, the newton-raphson with a initial look-up table is much faster. If done right, it can be as fast as ~30 cycles.
I hope this helps....