-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] fix symbol search loop at debuglink mode #70
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
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.
7c8f080
to
df606c6
Compare
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
FYA @ianlancetaylor |
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.