ELF-string table


 
Thread Tools Search this Thread
Top Forums Programming ELF-string table
# 1  
Old 01-25-2009
ELF-string table

hello everybody!
I want to read the string table of an object file(which is in ELF format).
I get the sh_name value but i cant find a way to read the value in the string table that this index represent. I program in C.
thanx a lot folks!
# 2  
Old 01-27-2009
You can use the elf library routines, or read the man pages on the ELF format.
# 3  
Old 01-27-2009
check out libelf here
libelf - Free Software Directory - Free Software Foundation

libbfd may already be on your system - it is fairly complex - but you can download & install it - there are versions for most systems.
# 4  
Old 01-30-2009
This section of the ELF gABI explains how to access the appropriate entry into the string table. Basicly, sh_name is an index into the section header string table section, as designated by the e_shstrndx member of the ELF header.

Have a look at the source code for the elf_print_symtab() routine in elfdump if you what to see one way of doing it.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Replacing string/special characters using a 'conversion' table

Hi, Does anyone know if there is a script or program available out there that uses a conversion table to replace special characters from a file? I am trying to remove some special characters from a file but there are several unprintable/control characters that some I need to remove but some I... (2 Replies)
Discussion started by: newbie_01
2 Replies

2. Shell Programming and Scripting

ps -elf AND grep for changes

Hoping theres something already out there like this. I have a list of proccesses who's "ps -elf" (field 10) values I need to continuously monitor and if the values of field 10 start to signiciantly increase (double, triple) then do something. The field 10 is the "memory size" field. (these... (4 Replies)
Discussion started by: ajp7701
4 Replies

3. BSD

DG/UX ELF binary support

Anyone, perhaps got DG/UX ELF binaries running on an old *BSD system? I've tried a lot of different kinds, with COMPAT_SVR4 compiled in and ibcs support, all ended up with Segement Fault or Bus Error errors. (2 Replies)
Discussion started by: dgux
2 Replies

4. Shell Programming and Scripting

How can we create a string table in bash shell ?

Hello, How can we write the pseudo code below using Bash shell scripting? table = ; i=0; do{ grep table h.txt; }while(i<3); or table = ; i=0; for(i=0;i<3;i++) grep table h.txt; (4 Replies)
Discussion started by: dbgork
4 Replies

5. UNIX for Dummies Questions & Answers

string replacement using a lookup table

Dear all thanks for helping in advance.. Know this should be fairly simple but I failed in searching for an answer. I have a file (replacement table) containing two columns, e.g.: ACICJ ACIDIPHILIUM ACIF2 ACIDITHIOBACILLUS ACIF5 ACIDITHIOBACILLUS ACIC5 ACIDOBACTERIUM ACIC1 ACIDOTHERMUS... (10 Replies)
Discussion started by: roussine
10 Replies

6. 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

7. 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

8. Shell Programming and Scripting

Search, replace string in file1 with string from (lookup table) file2?

Hello: I have another question. Please consider the following two sample, tab-delimited files: File_1: Abf1 YKL112w Abf1 YAL054c Abf1 YGL234w Ace2 YKL150w Ace2 YNL328c Cup9 YDR441c Cup9 YDR442w Cup9 YEL040w ... File 2: ... ABF1 YKL112W ACE2 YLR131C (9 Replies)
Discussion started by: gstuart
9 Replies

9. Programming

Editing or Adding to ELF string tables

Is it possible to add - or edit - data (the strings) contained within the string table of an ELF executable? I know I can access the string table with the following code; while ((scn = elf_nextscn(m_elf, scn)) != 0) { char *name = 0; gelf_getshdr(scn, &shdr); ... (9 Replies)
Discussion started by: Dhodder
9 Replies

10. UNIX for Dummies Questions & Answers

Running elf files

I have a few questions about elf files and how they are executed. When gcc compiles a elf file it creates an executable. Is this executable then run directly by the hardware or does the kernel get involved, interpret the elf file and place the asm code directly in memory. Cheers (0 Replies)
Discussion started by: mshindo
0 Replies
Login or Register to Ask a Question