Commit df606c6
[PATCH] fix symbol search loop at debuglink mode
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.1 parent 4f57c99 commit df606c6
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
917 | 917 | | |
918 | 918 | | |
919 | 919 | | |
| 920 | + | |
920 | 921 | | |
921 | 922 | | |
922 | 923 | | |
| |||
936 | 937 | | |
937 | 938 | | |
938 | 939 | | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
939 | 943 | | |
940 | 944 | | |
941 | 945 | | |
| |||
1026 | 1030 | | |
1027 | 1031 | | |
1028 | 1032 | | |
1029 | | - | |
| 1033 | + | |
| 1034 | + | |
1030 | 1035 | | |
1031 | 1036 | | |
1032 | 1037 | | |
| |||
1037 | 1042 | | |
1038 | 1043 | | |
1039 | 1044 | | |
1040 | | - | |
| 1045 | + | |
1041 | 1046 | | |
1042 | 1047 | | |
1043 | 1048 | | |
| |||
1049 | 1054 | | |
1050 | 1055 | | |
1051 | 1056 | | |
1052 | | - | |
| 1057 | + | |
1053 | 1058 | | |
1054 | 1059 | | |
1055 | 1060 | | |
| |||
0 commit comments