diff options
author | Jim Wilson <wilson@tuliptree.org> | 2005-05-31 19:32:29 +0000 |
---|---|---|
committer | Jim Wilson <wilson@tuliptree.org> | 2005-05-31 19:32:29 +0000 |
commit | 653bb2ded0633433a664b96afdec4cbf620315b5 (patch) | |
tree | deade62e61ae3bc8825214cb1e6d6093f82d4f7e | |
parent | 988392e2f52d8c962f5aa7da8ba04985c0393529 (diff) | |
download | gdb-653bb2ded0633433a664b96afdec4cbf620315b5.zip gdb-653bb2ded0633433a664b96afdec4cbf620315b5.tar.gz gdb-653bb2ded0633433a664b96afdec4cbf620315b5.tar.bz2 |
Fix for IA-64 gdb backtrace of threads in syscalls, reported by Jeff Johnson.
* elfcode.h (NAME(bfd_elf,bfd_from_remote_memory)): Check for program
header PF_R flag on PT_LOAD segments.
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elfcode.h | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3830be8..0069e64 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2005-05-31 James E Wilson <wilson@specifixinc.com> + + * elfcode.h (NAME(bfd_elf,bfd_from_remote_memory)): Check for program + header PF_R flag on PT_LOAD segments. + 2005-05-30 Richard Henderson <rth@redhat.com> * elf64-alpha.c (elf64_alpha_relocate_section): Use dtp_base for diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 102b215..6cb3ca2 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -1656,7 +1656,10 @@ NAME(_bfd_elf,bfd_from_remote_memory) for (i = 0; i < i_ehdr.e_phnum; ++i) { elf_swap_phdr_in (templ, &x_phdrs[i], &i_phdrs[i]); - if (i_phdrs[i].p_type == PT_LOAD) + /* IA-64 vDSO may have two mappings for one segment, where one mapping + is executable only, and one is read only. We must not use the + executable one. */ + if (i_phdrs[i].p_type == PT_LOAD && (i_phdrs[i].p_flags & PF_R)) { bfd_vma segment_end; segment_end = (i_phdrs[i].p_offset + i_phdrs[i].p_filesz @@ -1703,7 +1706,10 @@ NAME(_bfd_elf,bfd_from_remote_memory) } for (i = 0; i < i_ehdr.e_phnum; ++i) - if (i_phdrs[i].p_type == PT_LOAD) + /* IA-64 vDSO may have two mappings for one segment, where one mapping + is executable only, and one is read only. We must not use the + executable one. */ + if (i_phdrs[i].p_type == PT_LOAD && (i_phdrs[i].p_flags & PF_R)) { bfd_vma start = i_phdrs[i].p_offset & -i_phdrs[i].p_align; bfd_vma end = (i_phdrs[i].p_offset + i_phdrs[i].p_filesz |