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 | a4c8f44af9ee28a4c1a3713f6bf3d729cf2fc5a9 (patch) | |
tree | d1d6bd5c2641b63955fc805bc291dd347692b656 /bfd/elfcode.h | |
parent | e0dfed924007758dd680137f7f1abaf9060f10e3 (diff) | |
download | binutils-redhat-a4c8f44af9ee28a4c1a3713f6bf3d729cf2fc5a9.tar.gz |
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.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r-- | bfd/elfcode.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 102b215949..6cb3ca299a 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 |