URL: https://linuxfr.org/forums/linux-noyau/posts/d%C3%A9compression-dun-vmlinuz-avec-les-symboles-de-debug Title: Décompression d'un vmlinuz avec les symboles de debug Authors: Nicolas Greneche Date: 2009年05月25日T12:59:48+02:00 Tags: ubuntu Score: 0 Hello, J'ai une question sur la disponibilité des symboles de debug dans les packages types linux-image-2.6.28-11-generic pour Ubuntu 9.04. J'utilise systemtap qui nécessite d'avoir ces symboles. Seulement, systemtap demande un vmlinux (image décompressée du noyau) et le fichier fourni par Ubuntu est un vmlinuz (image compressée + divers en-têtes). J'ai réussi à obtenir une image décompressée mais les symboles restent introuvables. Voila le cheminement : 1) Vérification des options de compilation du vmlinuz : root@airjordan:~# grep CONFIG_DEBUG_INFO /boot/config-2.6.28-11-generic root@airjordan:~# grep CONFIG_KPROBES /boot/config-2.6.28-11-generic root@airjordan:~# grep CONFIG_RELAY /boot/config-2.6.28-11-generic root@airjordan:~# grep CONFIG_DEBUG_FS /boot/config-2.6.28-11-generic root@airjordan:~# grep CONFIG_MODULES /boot/config-2.6.28-11-generic root@airjordan:~# grep CONFIG_MODULE_UNLOAD /boot/config-2.6.28-11-generic Tout est bon, je cherche donc l'en-tête du gzip (1f 8b 08 00) encapsulé dans le vmlinuz. 2) Récupération de l'offset de départ du gzip : root@airjordan:~# od -A d -t x1 vmlinuz-2.6.28-11-generic> toto.txt Dans toto.txt : ... 0012912 00 fd f3 a4 fc 5e 81 c5 ff ff 0f 00 81 e5 00 00 0012928 f0 ff 8d 83 00 0f 35 00 ff e0 6a 0e 35 00 1f 8b 0012944 08 00 58 e4 e7 49 02 03 ec 3b 7f 74 93 55 96 2f ... Le gzip démarre donc à 12942. Je le dump et l'extrait : root@airjordan:~# dd if=vmlinuz-2.6.28-11-generic bs=1 skip=12942 | zcat> /boot/vmlinux-2.6.28-11-generic Un coup de file sur le vmlinux crée : root@airjordan:~# file /boot/vmlinux-2.6.28-11-generic /boot/vmlinux-2.6.28-11-generic: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped Mais quand j'execute un script systemtap : root@airjordan:~/stap# stap tcp_connections.stp WARNING: cannot find module kernel debuginfo: No such file or directory WARNING: cannot find module kernel debuginfo: No such file or directory C'est le drame ! Idem avec gdb : root@airjordan:/boot# gdb vmlinux-2.6.28-11-generic GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <[http://gnu.org/licenses/gpl.html](http://gnu.org/licenses/gpl.html)> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu"... (no debugging symbols found) On dirait qu'ils ne sont pas présents. Est ce que ma manip est trop bourrin ? Connaissez - vous un autre moyen d'arriver a récupérer le vmlinux ? Systemtap fonctionne avec un noyau compilé à la main mais c'est pas très ergonomique, il faut recompiler à chaque MaJ ... Merci d'avance,