OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Undefined Symbol: __divsi3, solved
telemetric_au
post Jul 6 2007, 12:20 AM
Post #1





Group: Members
Posts: 327
Joined: 28-February 06
From: South East of South Australia
Member No.: 9,251



/usr/lib/libkgsha.so: undefined symbol: __divsi3
Can not Load Key Generators


i guess it trying to load/use theis module which is part of package i compile with new testing gcc-2.95.3 fpa native toolchain

i get the feeling from looking around it could be result of a few things...

if my path is set to default vfp toolchain i get:
CODE
# ldd /usr/lib/libkgsha.so
       libc.so.6 => /lib/libc.so.6 (0x40011000)
       /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaaa000)
#


if my path is set to the new toolchain i get:

CODE
# ldd /usr/lib/libkgsha.so
       libc.so.6 => /lib/libc.so.6 (0x40011000)
       /opt/native/arm/2.95.3-armv4l-hardfpa//lib/ld-linux.so.2 => /opt/native/arm/2.95.3-armv4l-hardfpa//lib/ld-linux.so.2 (0x2aaaa000)
#


and if i add my new toolchain's /lib to the LD_LIBRARY_PATH i get :

CODE
# ldd /usr/lib/libkgsha.so
       libc.so.6 => /opt/native/arm/2.95.3-armv4l-hardfpa/lib/libc.so.6 (0x40012000)
       /opt/native/arm/2.95.3-armv4l-hardfpa//lib/ld-linux.so.2 => /opt/native/arm/2.95.3-armv4l-hardfpa//lib/ld-linux.so.2 (0x2aaaa000)
#


maybe it has some thing to so with the source code for the module ??

CODE
# *******************************************************************
# *     Copyright (c) 1994-2005 Jetico, Inc., Finland
# *     All rights reserved.
# *
# *     File:           Makefile
# *
# *     Description:    kgsha makefile
# *
# *     Scope:          SHA-1 key generator
# *
# *     Platforms:      Linux
# *
# *     Author:         Vitaliy Zolotarev
# *
# *     Revision:    $Id: Makefile,v 1.11 2007/02/08 06:48:34 nail Rel-1.6-13 $
# *
# *******************************************************************/                                                        #

LD = ld -d -shared

CPP=g++
#CPPFLAGS = -fPIC -Wall -Werror -fno-strength-reduce -I../include -g
CPPFLAGS = -fPIC -Wall -fno-strength-reduce -I../include -O2
CPPFLAGS += $(EXTRA_CXXFLAFS)

TARGET = libkgsha.so
HEADERS = kg_defs.h kgsha.h kblock.h sha1.h random.h

OBJ = alg.o kblock.o kg_misc.o kgsha.o pwldlg.o sha1.o random.o

all: $(TARGET)

%.o: %.cpp
    $(CPP) $(CPPFLAGS) -c -o $@ $<

$(TARGET):    $(OBJ)
 $(LD) $(OBJ) -soname $(TARGET) -o $(TARGET) -lc
 cp -f $(TARGET) ../lib
#  cp -f $(HEADERS) ../include
clean:
    rm -f *.o *.ver *~ $(TARGET)



for example i found this on a site out there:

QUOTE
AsIDE will now automatically create an Intel-HEX format file after every build.
I'm getting getting a linker error undefined reference to `__divsi3' when I build my application. Why?
You need to link in the library libgcc.a. Within AsIDE:
1. Select Project|Project Properties|Tools
2. Select Link in the Tool name list
3. Click the Options... button
4. Add the following line to Libraries/Objects:

-L %(GCC_EXEC_PREFIX)\arm-elf\3.3.1 -lc -lgcc

Where -lgcc is shorthand for libgcc.a. AsIDE will now automatically link in libgcc.a after every build.


maybe something similiar could help... ?
Go to the top of the page
 
+Quote Post
telemetric_au
post Jul 6 2007, 04:20 AM
Post #2





Group: Members
Posts: 327
Joined: 28-February 06
From: South East of South Australia
Member No.: 9,251



(i think its an old gcc thing)

yep, just add the following to the end of the linker command ( $(LD) $(OBJ) -soname $(TARGET) -o $(TARGET) -lc) in the Makefile for the .o file::


-L/opt/native/arm/2.95.3-armv4l-hardfpa/lib/gcc-lib/armv4l-unknown-linux-gnu/2.95.3/ -lgcc


ie path to libgcc.a which defines __divsi3 among other goodies wink.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 29th December 2014 - 05:50 AM