From 9cc3e70c0e6d2572a2f3a7dbbcfab1592319692a Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 3 Nov 2011 21:20:47 +0100 Subject: [PATCH] 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. --- translate.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; -- 2.43.5