[PATCH] fix symbol search loop at debuglink mode #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some distribs like ubuntu'18 creatively name files with debug symbols.
(same name without .debug suffix). And give no
build-id
way.$dpkg -L libc6-dbg | grep -v gconv
/usr/lib/debug/.build-id/68/f36706eb2e6eee4046c4fdca2a19540b2f6113.debug
/usr/lib/debug/lib/x86_64-linux-gnu/libc-2.27.so
$ dpkg -L libc6
/lib/x86_64-linux-gnu/libc-2.27.so
/lib/x86_64-linux-gnu/libc.so.6
$ objdump -s -j .gnu_debuglink -j .note.gnu.build-id
/lib/x86_64-linux-gnu/libc-2.27.so
Contents of section .gnu_debuglink:
0000 6c696263 2d322e32 372e736f 00000000 libc-2.27.so....
0010 5ac51387 Z...
Contents of section .note.gnu.build-id:
0270 04000000 14000000 03000000 474e5500 ............GNU.
0280 ce450eb0 1a5e5acc 7ce7b8c2 633b02cc .E...^Z.|...c;..
0290 1093339e ..3.
So elf_find_debugfile_by_debuglink("libc") loops back to
/lib/x86_64-linux-gnu/libc-2.27.so and can't lookup symbols for libc and
another standard libs. This patch breaks this loop and allows to lookup
for symbols at other places.