Sponsored Content
Top Forums Programming how to view symbol table in unix Post 302167230 by H2OBoodle on Thursday 14th of February 2008 12:02:44 AM
Old 02-14-2008
Here's an example of dumping the symbols from an object file (hello world in foo.c -> foo.o):

me@mine:~$ objdump -t foo.o

foo.o: file format elf32-i386

SYMBOL TABLE:
00000000 l df *ABS* 00000000 foo.c
00000000 l d .text 00000000 .text
00000000 l d .data 00000000 .data
00000000 l d .bss 00000000 .bss
00000000 l d .rodata 00000000 .rodata
00000000 l d .note.GNU-stack 00000000 .note.GNU-stack
00000000 l d .comment 00000000 .comment
00000000 g F .text 00000026 main
00000000 *UND* 00000000 puts
 

8 More Discussions You Might Find Interesting

1. Programming

no symbol table

Hi@all, I try to compile c code on hpux 11.11 pa-risc 2 with gcc (32bit). I compile with the option -g, so that I get the symbol table, but it is not available. Does someone knows something on this? thx (2 Replies)
Discussion started by: Dom_Cyrus
2 Replies

2. Linux

Reading ELF file Symbol table of C++ program

Folks, I have some program(Test.cpp) as follows, #include<iostream> class Abc { private: int _theVar; public : int printVar(); }; int Abc :: printVar() { _theVar=10; } main() { Abc _t; (0 Replies)
Discussion started by: vinod_chitrali
0 Replies

3. Programming

Reading ELF file Symbol table of C++ program

Folks, I have some program(Test.cpp) as follows, #include<iostream> class Abc { private: int _theVar; public : int printVar(); }; int Abc :: printVar() { _theVar=10; } main() { Abc _t; (2 Replies)
Discussion started by: vinod_chitrali
2 Replies

4. Programming

Symbol table of a C program

Hi, is there any command to see symbol table info. will it show where its allocating memory for varibales golbals & locals and code.(i mean the segments). i read there is a section called read only data segment and this is where initialized data such as strings stores. i have wriiten the... (7 Replies)
Discussion started by: MrUser
7 Replies

5. Solaris

/usr/lib/passwdutil.so.1: symbol __nsl_fgetspent_r: referenced symbol not found

deleteing post (0 Replies)
Discussion started by: dshakey
0 Replies

6. Shell Programming and Scripting

Read Table,View,Package,Function and Procedure Name in a File

Hi I am new to Unix shell scripting. But i need help to slove the below issue. Issue description: I want to read table, view names and package names in a file my plan to find the table name is : search "From" key word find the table or view To find the packge name : Search "Package... (5 Replies)
Discussion started by: sboss
5 Replies

7. Shell Programming and Scripting

Table or view is not exist

If I select the statement on db is ok, but same statement on UNIX script I get table or view is not exist. what should I do?:( (5 Replies)
Discussion started by: Hscript
5 Replies

8. Programming

Search the symbol table of a child process

Hi, I am a newbie in Linux land, and I have a question about programming parent/child process interaction: How do I search the value of a symbol in the child process? Is it possible? I am doing a fork() and execve() to spawn any child possible, and I need something on the parent side to... (12 Replies)
Discussion started by: alphakili
12 Replies
ldtbread(3)						     Library Functions Manual						       ldtbread(3)

NAME
ldtbread - Read an indexed symbol table entry of a common object file SYNOPSIS
#include <stdio.h> #include <filehdr.h> #include <syms.h> #include <ldfcn.h> int ldtbread (ldptr, symindex, symbol) LDFILE *ldptr ; long symindex ; pSYMR *symbol ; DESCRIPTION
The ldtbread routine reads the symbol table entry specified by symindex of the common object file currently associated with ldptr into the area of memory beginning at symbol. It returns SUCCESS or FAILURE. If symindex is greater than the number of symbols in the object file or if it cannot read the specified symbol table entry, ldtbread fails. The local and external symbols are concatenated into a linear list. Symbols are accessible from symbol index zero to SYM- HEADER(ldptr).isymMax + SYMHEADER(ldptr).iextMax. The index and iss fields of the SYMR are made absolute (rather than file relative) so that the routines ldgetname(3), ldgetaux(3), and ldtbread proceed normally given those indices. Only the SYMR part of the external symbol structure is returned. NOTE: The first symbol in the symbol table has an index of zero. The program must be loaded with the object file access routine library libmld.a. RELATED INFORMATION
ldclose(3), ldgetname(3), ldopen(3), ldtbseek(3), ldgetname(3), ldfcn(4). delim off ldtbread(3)
All times are GMT -4. The time now is 03:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy