From: Mark Wielaard Date: Thu, 3 Nov 2011 20:20:47 +0000 (+0100) Subject: translate.cxx (get_unwind_data): Only get .eh_frame for SHT_PROGBITS sections. X-Git-Tag: release-1.7~151^2~23 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=9cc3e70c0e6d2572a2f3a7dbbcfab1592319692a;p=systemtap.git translate.cxx (get_unwind_data): Only get .eh_frame for SHT_PROGBITS sections. This is really a bug somewhere in the toolchain. Only observed on s390x for the kernel debuginfo vmlinux image. But it is a good sanity check in general. See also rhbz#751197. --- diff --git a/translate.cxx b/translate.cxx index 64de6661a..403e90248 100644 --- a/translate.cxx +++ b/translate.cxx @@ -5307,7 +5307,9 @@ static void get_unwind_data (Dwfl_Module *m, bool eh_frame_hdr_seen = false; shdr = gelf_getshdr(scn, &shdr_mem); const char* scn_name = elf_strptr(elf, ehdr->e_shstrndx, shdr->sh_name); - if (!eh_frame_seen && strcmp(scn_name, ".eh_frame") == 0) + if (!eh_frame_seen + && strcmp(scn_name, ".eh_frame") == 0 + && shdr->sh_type == SHT_PROGBITS) { data = elf_rawdata(scn, NULL); *eh_frame = data->d_buf; @@ -5320,7 +5322,9 @@ static void get_unwind_data (Dwfl_Module *m, *eh_addr = shdr->sh_addr; eh_frame_seen = true; } - else if (!eh_frame_hdr_seen && strcmp(scn_name, ".eh_frame_hdr") == 0) + else if (!eh_frame_hdr_seen + && strcmp(scn_name, ".eh_frame_hdr") == 0 + && shdr->sh_type == SHT_PROGBITS) { data = elf_rawdata(scn, NULL); *eh_frame_hdr = data->d_buf;