Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to obtain list of object files in a shared (dynamic) library? Post 302350854 by jim mcnamara on Saturday 5th of September 2009 08:31:08 PM
Old 09-05-2009
readelf (usually on linux but -- any ELF object file on any platform that supports ELF)

will read a shared library. Shared libraries are the product of link edit -- ld. They are not the product of ar. They don't retain the names of source files for the symbols in the ELF file by default. Or if you think I'm not correct read the ELF file specs yourself. Search for "source"

http://www.skyfree.org/linux/references/ELF_Format.pdf

Note: The .line specification is for debugging executable images and relating a source file and the object code to one another. When objectds are compiled in debug mode.

Last edited by jim mcnamara; 09-05-2009 at 09:38 PM..
 

10 More Discussions You Might Find Interesting

1. Linux

load dynamic and shared library in kernel

hi how can i load dynamic or shared library in linux kernel modules . mtaghiloo@yahoo.com (0 Replies)
Discussion started by: mtaghiloo
0 Replies

2. Linux

Shared Object File

Hi All, I created the share object file using gcc -shared -fpic mypp.cpp -o myp.so but, pls tell me how to link this .so file to my client program. Thanks (0 Replies)
Discussion started by: sarwan
0 Replies

3. AIX

Shared Object library problem

Hi, When using shared objects on AIX 4.3 i am getting runtime problems. I have a small sample program which links to a shared object libray, oracle and system related libraries. At runtime it fails (gives segmentation fault and coredump ) in one proc file when executing login statement. But... (0 Replies)
Discussion started by: suman_jakkula
0 Replies

4. Shell Programming and Scripting

Any way to access shared object using shell

Hi, I have created a shared object (abc.so) which has a function sum(int a, int b). Is there any way to load the "abc.so" and use the sum function using shell script.. thanks in advance (2 Replies)
Discussion started by: yhacks
2 Replies

5. Shell Programming and Scripting

How to change a Makefile from building static library to shared library?

Hi: I have a library that it only offers Makefile for building static library. It built libxxx.a file. How do I in any way build a shared library? (either changin the Makefile or direct script or command to build shared library) Thanks. (1 Reply)
Discussion started by: cpthk
1 Replies

6. UNIX for Dummies Questions & Answers

Problem with shared dynamic library files

I am having a major problem. Most of the commands that i am running on my centos 5 system is giving the error of type: <dynamic shared library file>:open failed: No such file or directory For example: libgcc_s.so.1: open failed: No such file or directory How can i solve this? (6 Replies)
Discussion started by: proactiveaditya
6 Replies

7. Red Hat

shared object

Hi, I would like to create a shared object ( .so). This shared object 1. uses the functions from a library. 2. Also it should be able to use the global variable in an app To achieve this what should I do ? 1) To use the functions in the library should I give the -ld option while... (1 Reply)
Discussion started by: rvan
1 Replies

8. Programming

Shared Object Question

Hello, I am new to programming shared objects and I was hoping someone could tell me if what I want to do is possible, or else lead me in the right direction. I have a main program that contains an abstract base class. I also have a subclass that I'm compiling as a shared object. The subclass... (13 Replies)
Discussion started by: dorik
13 Replies

9. Programming

Shared library with acces to shared memory.

Hello. I am new to this forum and I would like to ask for advice about low level POSIX programming. I have to implement a POSIX compliant C shared library. A file will have some variables and the shared library will have some functions which need those variables. There is one special... (5 Replies)
Discussion started by: iamjag
5 Replies

10. AIX

Add shared members from library to same library in a different directory

I'm trying to install libiconv to AIX 7.1 from an rpm off of the perzl site. The rpm appears to install but I get this error message. add shr4.o shared members from /usr/lib/libiconv.a to /opt/freeware/lib/libiconv.a add shr.o shared members from /usr/lib/libiconv.a to ... (5 Replies)
Discussion started by: kneemoe
5 Replies
ELF_CNTL(3)						   BSD Library Functions Manual 					       ELF_CNTL(3)

NAME
elf_cntl -- control an elf file descriptor LIBRARY
ELF Access Library (libelf, -lelf) SYNOPSIS
#include <libelf.h> int elf_cntl(Elf *elf, Elf_Cmd cmd); DESCRIPTION
Function elf_cntl() controls the ELF library's subsequent use of the file descriptor used to create ELF descriptor elf. Argument cmd informs the library of the action to be taken: ELF_C_FDDONE This value instructs the ELF library not to perform any further I/O on the file descriptor associated with argument elf. For ELF descriptors opened with mode ELF_C_WRITE or ELF_C_RDWR subsequent elf_update() operations on the descriptor will fail. ELF_C_FDREAD This value instructs the ELF library to read in all necessary data associated with ELF descriptor elf into memory so that the underlying file descriptor can be safely closed with command ELF_C_FDDONE. Argument elf must be an ELF descriptor associated with a file system object (e.g., an ar(1) archive, an ELF file, or other data file). IMPLEMENTATION NOTES
Due to use of mmap(2) internally, this function is a no-op for for ELF objects opened in ELF_C_READ mode. RETURN VALUES
Function elf_cntl() returns 0 on success, or -1 if an error was detected. ERRORS
[ELF_E_ARCHIVE] Argument elf is a descriptor for an archive member. [ELF_E_ARGUMENT] Argument elf was NULL. [ELF_E_ARGUMENT] Argument cmd was not recognized. [ELF_E_MODE] An ELF_C_FDREAD operation was requested on an ELF descriptor opened for writing. SEE ALSO
elf(3), elf_begin(3), elf_end(3), elf_next(3), elf_update(3), gelf(3) BSD
August 9, 2006 BSD
All times are GMT -4. The time now is 12:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy