How can I find the list of symbols of the running linux process? Basically what nm
does, but in run time, without the need to read the binary file.
Asked
Active
Viewed 1,361 times
0

trozen
- 1,117
- 13
- 13
-
1Have looked in the `/proc` filesystem (and for the own process, `/proc/self`)? – Some programmer dude Dec 03 '18 at 14:06
1 Answers
1
You can't. That information is not loaded into RAM from the executable image. In fact, it might not be present at all, if the binary has been "stripped". Debuggers do exactly what nm
does: they open and read the binary file.
(Footnote: a subset of the running process's symbols may be loaded into memory for use by the dynamic loader. But there's no supported way to get a list of them.)

zwol
- 135,547
- 38
- 252
- 361
-
1Thanks, but actually you can do it, at least in some limited way with `dl_iterate_phdr` – trozen Dec 04 '18 at 10:27
-
@frozen Huh, I knew about that but I thought it was not supported for external use. – zwol Dec 06 '18 at 11:52