You are not logged in.

#1 2017-06-09 18:06:07

bsld
Member
Registered: 2016-05-29
Posts: 23

How to make the loader dump all undefined symbols

For example when I run "./idaq64qtaqta" I'll get only one undefined symbol at a time:

./idaq64qtaqta: symbol lookup error: ./idaq64qtaqta: undefined symbol: _ZN11QMessageBox15setEscapeButtonENS0_14StandardButtonE

My question is how to dump them all.


I'm currently fixing up/porting those but I'm afraid they may be too many so I want to see if it'll be even possible to continue doing this by hand.

What am I doing is translating the old library references to their modern versions like for example:

QTextStream::operator<<(QTextStream::QString const&)

_ZN11QTextStreamlsERKNS_7QStringE

Get translated to:

QTextStream::operator<<(QString const&)

_ZN11QTextStreamlsERK7QString

I don't know if it is a better way to do it but if I can see all the undefined symbols from the binary it'll help a lot.

Last edited by bsld (2017-06-09 18:11:18)

Offline

#2 2017-06-09 18:31:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: How to make the loader dump all undefined symbols

nm -u /path/to/binary

That will dump all symbols used but not defined within that binary.  Note, though that this will include symbols that would successfully be looked up in shared libs.  So it is sensitive, but not specific for your needs.

edit: ldd -r might be more useful, e.g.:

ldd -r /path/to/binary | awk '/undefined/ { print $3; }'

However, I'm not sure I'm clear on how you are "fixing" these.  The best fix would simply to be rebuild the binary against the current libs.

Last edited by Trilby (2017-06-09 18:41:51)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB