Questions tagged [nm]

nm is a POSIX tool that displays symbol names and other such information of an object file to stdout

230 questions
9
votes
2 answers

In C, why does my initialized to 0 int variable get reported as uninitialized by "nm"?

I have the following C code: //declared at the beginning of the CAStar.c file: int TERRAIN_PASSABLE = 1; int TERRAIN_IMPASSABLE = 0; int TERRAIN_SOME_WHAT_PASSABLE = 2; I've noticed that for any of these variables, if they have a…
Shivan Dragon
  • 15,004
  • 9
  • 62
  • 103
8
votes
3 answers

Why is the `nm` utility named as such?

The nm the utility to list symbols in a binary doesn't include in its documentation any explanation or clue of how it got to be named nm. I imagine some of the long experienced UNIX developers can shed some light. Why is the nm utility named as…
Catskul
  • 17,916
  • 15
  • 84
  • 113
8
votes
1 answer

How to patch 3rd party .so file, to access non-exported symbol (C++)

I have some binary .fic files in a proprietary format , I have a wd250hf64.so from this vendor that contains a C++ method CComposanteHyperFile::HExporteXML(wchar_t* const path) that I can see using nm $ nm --demangle wd250hf64.so …
allan.simon
  • 3,886
  • 6
  • 35
  • 60
8
votes
2 answers

How to display the symbol's type like the nm command?

I'm studying the ELF format right now. I have to code a simple nm fonction (without the options). I'm already printing on the output the symbol's value and the symbol's name. Here's the nm output : value type name 0000000000600e30 D …
7
votes
2 answers

How to find function from lib .so files?

I can print list of exported function of one *.so file like nm -C lib/libopencv_ml.so and then find my function like nm -C lib/libopencv_ml.so | grep myfunction but when I want to find function from all .so files how to determine which .so contain…
mrgloom
  • 20,061
  • 36
  • 171
  • 301
7
votes
1 answer

how do i use find, nm, and grep to find a symbol among many shared libraries?

I'm struggling with the right command to do the following: find all shared libraries (*.so) that contain a certain symbol. This is what I've tried: find -iname '*.so*' -exec nm {} \; | grep -H _ZN6QDebugD1Ev The above gives some output with symbols…
Rich von Lehe
  • 1,362
  • 2
  • 16
  • 38
7
votes
1 answer

Errors that refer to a bunch of unresolved OpenSSL symbols that clearly exist?

I am building a shared library (we'll call it "foo") that makes use of another library (we'll call it "bar"). "bar" makes use of some functions from OpenSSL. Here's where the problem surfaces. "bar" was compiled as a static library and it would…
Nathan Osman
  • 71,149
  • 71
  • 256
  • 361
7
votes
4 answers

Offset in nm symbol value?

Just to give you some context, here's what I'm trying to achieve: I am embedding a const char* in a shared object file in order to have a version string in the .so file itself. I am doing data analysis and this string enables me to let the data know…
Simon
  • 961
  • 2
  • 9
  • 14
6
votes
1 answer

How to remove these mangled selectors from iOS app

I need help in removing known mangled selectors in my iOS app. Apple rejected my app stating: Regarding Guideline 2.3.1, this app is verified to contain mangled selectors such as - x7kQPFEZS4af59md1eVMqf42YSTGAZVO: and…
Ratan
  • 301
  • 2
  • 13
6
votes
2 answers

nm symbol both "U" and "T", what does that mean?

I am having an undefined symbol error at runtime, and when I look for the symbol in the relevant library, I get the result: nm -C -D /home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/pyscannerbit/libScannerBitCAPI.so | grep empty_ …
Ben Farmer
  • 2,387
  • 1
  • 25
  • 44
6
votes
2 answers

How to determine inter-library dependencies?

My project consists of a couple of static libraries, which are linked together in a final step. Now I have the problem, that the link order of the library is important (otherwise I get an undefined symbol linker error). Sometimes I run into the…
Charly
  • 1,270
  • 19
  • 42
6
votes
2 answers

What does (.eh) mean in nm output?

When I look at the symbols in my library, nm mylib.a, I see some duplicate entries that look like this: 000000000002d130 S __ZN7quadmat11SpAddLeavesC1EPNS_14BlockContainerEPy 00000000000628a8 S…
Adam
  • 16,808
  • 7
  • 52
  • 98
6
votes
2 answers

Can't find .dtors and .ctors in binary

I am reading the book Hacking, the art of exploitation. In the book there is a section that explain the use of .dtors and .ctors. I'm trying to reproduce one of the exercises of the book but in my executable I do not have this sections. At first I…
Alejandro Alcalde
  • 5,990
  • 6
  • 39
  • 79
6
votes
1 answer

Strange linking behaviour and undefined symbols

I am linking an external library (via wierd process, mpicc + Cython + etc), but I have a weird behaviour of a linking procedure. There are two .o files, libpetsc4py.o and PETSc.o they are linked into a .so file PETSc.so One contains an undefined…
Ivan Oseledets
  • 2,270
  • 4
  • 23
  • 28
5
votes
1 answer

Determine load address and entry point of stripped Linux Kernel image

I have a crosscompiling toolchain for an embedded system (mipsel) on my x86 Linux. I know how to build a custom kernel (let's call the image "vmlinux") for it and how to strip that image via objcopy -S -O binary vmlinux vmlinux.bin For further…
kriegaex
  • 63,017
  • 15
  • 111
  • 202
1
2
3
15 16