Questions tagged [nm]

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

230 questions
0
votes
0 answers

How to locate symbols in a debug binary

I think nm is the tool, but none of the tutorials has helped me solve my problem. Let's say I have a debug built binary and a stack trace where it crashes. The stack trace says something like foo() + 1500. I assume the number is bytes of offset in…
Vorac
  • 8,726
  • 11
  • 58
  • 101
0
votes
3 answers

How to know the visibility of a symbol in an object file

The visibility (from __ attribute __(visibility("...")) and -fvisibility) of a symbol can be known from a so file nm -C lib.so t is hidden, T is exported(i.e. default). But how to get this information from an object file directly? nm -C lib.o Will…
jw_
  • 1,663
  • 18
  • 32
0
votes
0 answers

What is the proper way to set a constant in gnu assembler for the x86_64 processor family

I am teaching myself x86_64 assembly and my reference texts are in intel syntax and I am interested in using AT&T syntax with the gnu assembler and have figured out most of the difference but I cant figure out what is the proper way to set constants…
Zeno of Elea
  • 175
  • 11
0
votes
1 answer

Filter the output of GNU nm by section

I'm trying to identify the largest symbols in an .elf file for each memory section (.text, .data, .bss). So far I'm using GNU nm to get the largest symbols: nm foo.elf --size-sort --reverse-sort --radix=d --demangle --line-numbers Is there a…
S. Marti
  • 313
  • 1
  • 5
  • 13
0
votes
0 answers

Extracting symbol names from nm output

I'd like to use nm -P -g symbol names to generate a .c file. however I'm not sure how to extract those symbol names. Reading https://pubs.opengroup.org/onlinepubs/9699919799/utilities/nm.html says: The format given in nm STDOUT uses
SoniEx2
  • 1,864
  • 3
  • 27
  • 40
0
votes
2 answers

How to display local (non-external) symbols in a C-program using `nm` on macOS?

I want to display local (non-external) symbols in a C-program using nm on macOS. I've read the man nm, and it essentially gives me the following options for displaying symbol information: nm -m (Mach-O symbols) nm -g (external symbols) nm -a (all…
Shuzheng
  • 11,288
  • 20
  • 88
  • 186
0
votes
0 answers

Linking against a shared object but undefined reference occurs?

I am in a bit of a pickle. I do not seem to be able to figure out where the problem is: I have a simple test file (test.cpp): #include #include #include int main(){ RMF::FileHandle fh; fh =…
Kai
  • 376
  • 1
  • 4
  • 17
0
votes
0 answers

lstat64 and stat64 undefined

When I set LD_BIND_NOW to 1, and then try to invoke my debug build application, it does not invoke due to undefined symbols lstat64, when I run nm and grep on "stat64": U lstat64@@libkernel32.so U stat64@@libgdiuser32.so Where "libkernel32.so"…
mnabil
  • 695
  • 1
  • 5
  • 19
0
votes
0 answers

NM outputs cryptic symbol names

When I tried to figure out what was included into a shared library, I looked into the .so file with nm. The output was like the following: 0000000000075956 t _ZN10CoordinateC1Eff 0000000000075956 t _ZN10CoordinateC2Eff //something regarding the…
JFFIGK
  • 632
  • 1
  • 7
  • 24
0
votes
0 answers

How to determine Ram/Rom usage of elf using binutils?

I would like to extract the Ram and Rom usage of each module by the help of binutils tools. I have a couple of objects (relocatable elf files) and a final executable (elf) to determine those data from. I am writing a reusable (among different…
lukas
  • 1
  • 3
0
votes
0 answers

'nm' command doesn't work with "xargs" on my linux

I'm on linux and have libmy.so I can "nm libmy.so", OK. But when I tried: ls libmy.so|xargs nm It prints error: nm: 'libmy.so': No such file nm: '': No such file It's so odd. Where did I get wrong?
Hind Forsum
  • 9,717
  • 13
  • 63
  • 119
0
votes
1 answer

Is every undefined symbol associated with the library name it comes from?

Let's say that libA.so depends on libB.so, libC.so, libD.so. Is there a mapping between the undefined symbols and the required library names: undefined_symbol_1 comes from libB.so undefined_symbol_2 comes from libC.so undefined_symbol_3 comes from…
Alexey
  • 710
  • 3
  • 7
  • 19
0
votes
1 answer

What does this nm output "V typeinfo name for void*" mean?

Could you please tell me what do these pieces of nm's output mean? $nm --demangle --dynamic --defined-only --extern-only lib.so 0000000000238ba0 V typeinfo name for void* 0000000000238b80 V typeinfo for void* What are the C++ constructs they are…
Alexey
  • 710
  • 3
  • 7
  • 19
0
votes
1 answer

gmp error: cannot determine how to define a 32-bit word

I'm trying to build the recent version of GMP 6.1.2 on macOS Mojave, but during ./configure I get this: $ ../configure --prefix=/usr/local/gcc-8.2 --enable-cxx gmp_cv_asm_underscore=yes ... checking how to define a 32-bit word... /usr/local/bin/nm:…
Verloren
  • 859
  • 1
  • 8
  • 18
0
votes
1 answer

nm symbol names slightly different

I have an undefined symbol name in one shared lib: U _ZN5Daetk5Petsc3Sys10catchErrorEj In the shared lib that should resolve this, the symbol name is different in its last character: 000000000008c65e T _ZN5Daetk5Petsc3Sys10catchErrorEb These two…