nm is a POSIX tool that displays symbol names and other such information of an object file to stdout
Questions tagged [nm]
230 questions
0
votes
1 answer
nm - show file that declares a symbol in a .so file
Is it possible for nm to show the file that declares a symbol in a .so file? Let's say I have some file:
//file.cpp
int get_data();
int main(){
return 0;
}
If I compile this file into a shared object file, file.so, I should get a "U" for the…

Melandru's Square
- 429
- 3
- 12
0
votes
0 answers
Removing symbols from `.a`s
I'm compiling a C++ static library using g++ via Cmake. I want to remove symbols relating to the internal implementation so they don't show up in nm. (See here and here for the same with shared libraries.)
This answer tells you how to do it on iOS,…

Mohan
- 7,302
- 5
- 32
- 55
0
votes
1 answer
Print symbol of file .o
I want to print symbol of .o file (same of nm command).
I iterate on each section. And use this condition:
if (section[i].sh_type == SHT_SYMTAB)
{
sym = (Elf64_Sym *)((char *)content +
…

Mathie
- 7
- 5
0
votes
0 answers
Symbols "T _Z20" before exported function
Trying to find why client application can't find exported function in .so library I have done. I did
nm -D libmylib.so |grep " T " |grep aaa
and got answer:
T _Z20aaasPP8CashInfoPiS1_S2_S2_PcS3_
If I look to other functions that are visible to…

vico
- 17,051
- 45
- 159
- 315
0
votes
1 answer
Search mangle into libraries
I want to find some functions or structures into library files. For this purpose I'm using "nm" command using "find" command output as parameter files. (I want search in /usr/lib directory recursively) I tried with this command without success:
nm…

Rubén Pozo
- 1,035
- 1
- 12
- 23
0
votes
2 answers
How to handle a n:m relation correctly with PHP&MySQL?
i've got 3 tables:
+-----------------+
| validations |
+----+-------+----+
| id | param | ...
+----+-------+
+------------------+
| replacements |
+----+-------------+
| id | replacement…

d.hill
- 669
- 3
- 9
- 16
0
votes
1 answer
Why does the nm tool output for the extern-only and defined-only options overlap?
I'll start by giving my understanding of the options:
extern-only: Show me only those symbols which are referenced by the binary but whose definitions (the code or variable) will be provided by another binary
defined-only: Show me only those…

Verticon
- 2,419
- 16
- 34
0
votes
1 answer
I don't understand meaning of this: +"a function to be evaluated during reloc processing"
I don't understand meaning of this:
+"a function to be evaluated during reloc processing" - it is from flags of objdump.
How function can be evaluated during reloc processing?
Is it sequence of cpu opcodes (subrotinue) that must be called?
Or what?

rcm
- 1
- 4
0
votes
1 answer
Symbol lookup error at runtime even though nm reports symbol present
I build my program like this:
g++ -std=c++11 myprog.cpp -o myprog -lqpid-proton-cpp
Then I run ./myprog and get this error:
symbol lookup error: ./myprog: undefined symbol: _ZN6proton10event_loop6injectESt8functionIFvvEE
Yet, nm reports the symbol…

Greg Clinton
- 365
- 1
- 7
- 18
0
votes
0 answers
How to reverse compile a linux library?
I want to figure out what files are used to create a library. Is there a simple way to find this?
(Without using reverse engineering tools like Ida etc..)
I suspect it might be possible with some tool similar to nm. I didn't see any possibility by…

MadHatter
- 321
- 7
- 17
0
votes
1 answer
Using .so file without header file
I have a .so file, and I need to use the method in my c++ code. There is no header file. I decompile the necessary symbols by nm, and the found the method and class information are as follows.
00000000002ec9c0 B…

user2933783
- 81
- 6
0
votes
1 answer
what is __imp__malloc in a mingw-32 linked program?
In am attempt to figure out if malloc() in my cross-compiled mingw32 program is threadsafe or not, I ran nm on the binary. The results:
$ i386-mingw32-nm myfile.exe | grep malloc
00ab04fc I __imp__malloc
005b8e70 T _malloc
$
For comparison, here…

vy32
- 28,461
- 37
- 122
- 246
0
votes
0 answers
Building libcbor, but objects do not reflect in ELF
I have an ELF compiled from the sources having following file, size output:
bash.exe"-3.1$ file FreeRTOS_Trial_CubeMX_Project.elf
FreeRTOS_Trial_CubeMX_Project.elf: ELF 32-bit LSB executable, ARM, EABI5 version
1 (SYSV), statically linked, not…

Yusuf Husainy
- 625
- 8
- 19
0
votes
1 answer
Can't find the Symbol Table(Elf format) (C programming)
I'm actually recoding the nm and objdump program. I've already finished objdump and it works well, so i'm working on nm now.
I'm trying to find the Symbol table, in order to do that i run through the Section header table like this :
while (i <…

drumz
- 65
- 7
0
votes
1 answer
Multiple duplicate symbols in a single static object library
Why are there duplicate symbols in the same static object file? What does it mean in practice?
after running nm /lib64/libc.so.6 | cut -d' ' -f 3 | uniq -c | sort -rn, which looks at the symbols in the file and prints the number of times that the…

daniel
- 1
- 2