dlsym...error


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users dlsym...error
# 1  
Old 09-20-2005
Network dlsym...error

Hi,

I have ftp.so file which on nm gives the following table....

[138] |0x0000c4f8|0x000000f0|FUNC |LOCL |0 |14 |ftp_active
[160] |0x0000c00c|0x000000f0|FUNC |LOCL |0 |14 |ftp_ascii
[135] |0x0000c0fc|0x000000f0|FUNC |LOCL |0 |14 |ftp_binary
[163] |0x0000a8e0|0x000001a8|FUNC |LOCL |0 |14 |ftp_cd
[130] |0x0000bf20|0x000000ec|FUNC |LOCL |0 |14 |ftp_close
.
.
[178] |0x00000000|0x00000000|FUNC |GLOB |0 |UNDEF |Ls__9FTPClientRQ29FTPCl
ient8FileListPCc [FTPClient::Ls(FTPClient::FileList &, char const *)]


Now using dlopen and doing a dlsym on "ftp_cd", "ftp_ascii" is gives an error
saying
dlsym Couldn't find ftp_cd: ld.so.1: cor: fatal: ftp_cd: can't find symbol
while for "FTPClient::Ls(FTPClient::FileList &, char const *)" it does not give any error.
Can any one please tell me why and how can i get reference to these functions.

my code :
.
.
handle = dlopen("ftp.so",RTLD_NOW);
if(!handle) {
// print error..
}
dlerror();
fnc = ((int*)()(int)) dlsym(handle,FN_Name[i]);
if((error=dlerror())) {
// print error
}

.
.
here :
FN_Name[i] = contains mangled name entries from output of "nm" shown above.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Print Error in Console and both Error & Output in Log file - UNIX

I am writing a shell script with 2 run time arguments. During the execution if i got any error, then it needs to redirected to a error file and in console. Also both error and output to be redirected to a log file. But i am facing the below error. #! /bin/sh errExit () { errMsg=`cat... (1 Reply)
Discussion started by: sarathy_a35
1 Replies

2. Shell Programming and Scripting

IF section problem. syntax error: unexpected end of file error

Hello, I have another problem with my script. Please accept my apologies, but I am really nooby in sh scripts. I am writing it for first time. My script: returned=`tail -50 SapLogs.log | grep -i "Error"` echo $returned if ; then echo "There is no errors in the logs" fi And after... (10 Replies)
Discussion started by: jedzio
10 Replies

3. Solaris

Rpcinfo: can't contact portmapper: RPC: Authentication error; why = Failed (unspecified error)

I have two servers with a fresh install of Solaris 11, and having problems when doing rpcinfo between them. There is no firewall involved, so everything should theoretically be getting through. Does anyone have any ideas? I did a lot of Google searches, and haven't found a working solution yet. ... (2 Replies)
Discussion started by: christr
2 Replies

4. Shell Programming and Scripting

What is this error log = hda: irq timeout: error=0x00 and how to solve?

what is this error log = hda: irq timeout: error=0x00 and how to solve? every day upon checking the logs i see this error. hda: irq timeout: error=0x00 hda: irq timeout: error=0x00 hda: irq timeout: error=0x00 hda: irq timeout: error=0x00 hw_client: segfault at 0000000000000046 rip... (3 Replies)
Discussion started by: avtalan
3 Replies

5. UNIX for Dummies Questions & Answers

> 5 ")syntax error: operand expected (error token is " error

im kinda new to shell scripting so i need some help i try to run this script and get the error code > 5 ")syntax error: operand expected (error token is " the code for the script is #!/bin/sh # # script to see if the given value is correct # # Define errors ER_AF=86 # Var is... (4 Replies)
Discussion started by: metal005
4 Replies

6. UNIX for Dummies Questions & Answers

dlsym() returns 0 for an existing function

Sometimes I observe this in gdb: (gdb) br my_function Breakpoint .. at 0x...: file ..., line ... i.e., "my_function" does exist in the current executable. however, dlsym does not find it: (gdb) p dlsym(0,"my_function") $6 = 0 This is a C program; dlsym does find other defined functions and... (2 Replies)
Discussion started by: sds
2 Replies

7. AIX

nim mksysb error :/usr/bin/savevg[33]: 1016,07: syntax error

-------------------------------------------------------------------------------- Hello, help me please. I am trying to create a mksysb bakup using nim. I am geting this error, how to correct it ? : Command : failed stdout: yes stderr: no... (9 Replies)
Discussion started by: astjen
9 Replies

8. UNIX for Advanced & Expert Users

VSI-FAX error - Cannot login to server and Connecto error to host

I encounters a VSIFAX related error: vfxstat: Cannot login to server on rsac3: Connect error to host 172.16.1.45: Invalid argument It started happening last night with a core dump. Then we can't start VSIFAX again. I am runing VSI-FAX 4.2 on AIX box (0 Replies)
Discussion started by: b_jin
0 Replies

9. UNIX for Dummies Questions & Answers

awk Shell Script error : "Syntax Error : `Split' unexpected

hi there i write one awk script file in shell programing the code is related to dd/mm/yy to month, day year format but i get an error please can anybody help me out in this problem ?????? i give my code here including error awk ` # date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies

10. UNIX for Dummies Questions & Answers

Error: Internal system error: Unable to initialize standard output file

Hey guys, need some help. Running AIX Version 5.2 and one of our cron jobs is writing errors to a log file. Any ideas on the following error message. Error: Internal system error: Unable to initialize standard output file I'm guessing more info might be needed, so let me know. Thanks (2 Replies)
Discussion started by: firkus
2 Replies
Login or Register to Ask a Question
elfwrap(1)							   User Commands							elfwrap(1)

NAME
elfwrap - wrap data in an ELF file SYNOPSIS
elfwrap [-64] [-o relobj-file] [-z target=sparc | x86] data-file... DESCRIPTION
The elfwrap utility creates an ELF relocatable object file from one or more data files. The relocatable object encapsulates each data file within an individual section, together with symbols that can be used to reference the section. The relocatable object is appropriate for inclusion with a subsequent link-edit. Users can reference the encapsulated data using the associated symbols. By default, a 32-bit ELF relocatable object is created that is appropriate for the machine on which elfwrap is executed. The -64 option can be used to create a 64-bit ELF relocatable object. The -z target option can be used to create a relocatable object for a specific machine type. Note - Any data encapsulated with elfwrap must be in a format appropriate for the destination target. By default, the relocatable object a.wrap.o is created. The -o option can be used to specify an alternative relocatable object name. The basename(1) of each data file is used to create various pieces of ELF information. For example, if the input data file is ISV/isv- data, the following ELF information is created within the relocatable object. An ELF section named .isv-data This section contains the entire contents of the input data file. An ELF symbol named isv-data_start This symbol reflects the starting address of the .isv-data section. An ELF symbol named isv-data_end This symbol reflects the address of the first location after the .isv-data section. OPTIONS
The following options are supported: -64 Create a 64-bit ELF relocatable object. -o relobj-file Produce a relocatable object that is named relobj-file. -z target=sparc | x86 Specifies the machine type for the output relocatable object. Supported targets are sparc and x86. The 32-bit machine type for the specified target is used unless the -64 option is also present, in which case the corresponding 64-bit machine type is used. By default, the relocatable object that is generated is 32-bit for the machine one which elfwrap is executed. EXAMPLES
The following example encapsulates the system passwd file and the system group file within a relocatable object passgroup.o. example% elfwrap -o passgroup.o /etc/passwd /etc/group example% elfdump -s passgroup.o | egrep "passwd|group" [2] 0x00000000 0x00000000 SECT LOCL D 0 .passwd [3] 0x00000000 0x00000000 SECT LOCL D 0 .group [7] 0x00000000 0x000002f0 OBJT GLOB D 0 .passwd passwd_start [8] 0x000002f0 0x00000000 OBJT GLOB D 0 .passwd passwd_end [9] 0x00000000 0x00000121 OBJT GLOB D 0 .group group_start [10] 0x00000121 0x00000000 OBJT GLOB D 0 .group group_end example% strings -N.passwd passgroup.o | head -1 root:x:0:0:Super-User:/:/sbin/sh example% strings -N.group passgroup.o | head -1 root::0: This relocatable object can be referenced from the following user code. example% cat main.c #include <stdio.h> extern char passwd_start, passwd_end; void main() { char *pstart = &passwd_start, *pend = &passwd_end; char *str, *lstr; for (lstr = str = pstart; str < pend; str++) { if ((*str == '0) && (str != (pend - 1))) { (void) printf("%.*s", (++str - lstr), lstr); lstr = str; } } } example% cc -o main main.c passgroup.o example% ./main root:x:0:0:Super-User:/:/sbin/sh .... nobody4:x:65534:65534:SunOS 4.x NFS Anonymous Access User:/: FILES
a.wrap.o The default relocatable object file created. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWtoo | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
elfdump(1), ld(1), strings(1), elf(3ELF), attributes(5), ddi_modopen(9F) Linker and Libraries Guide SunOS 5.11 17 March 2008 elfwrap(1)