Skip to content

Commit

Permalink
Port fix from backward-cpp PR 165
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina committed Aug 6, 2020
1 parent bb83f19 commit f52c9f3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/vendor/backward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1235,12 +1235,24 @@ class TraceResolverLinuxImpl<trace_resolver_tag::libbfd>:
{
if (result.found) return;

#ifdef bfd_get_section_flags
if ((bfd_get_section_flags(fobj.handle.get(), section)
& SEC_ALLOC) == 0)
#else
if ((bfd_section_flags(section) & SEC_ALLOC) == 0)
#endif
return; // a debug section is never loaded automatically.

#ifdef bfd_get_section_vma
bfd_vma sec_addr = bfd_get_section_vma(fobj.handle.get(), section);
#else
bfd_vma sec_addr = bfd_section_vma(section);
#endif
#ifdef bfd_get_section_size
bfd_size_type size = bfd_get_section_size(section);
#else
bfd_size_type size = bfd_section_size(section);
#endif

// are we in the boundaries of the section?
if (addr < sec_addr || addr >= sec_addr + size) {
Expand Down

0 comments on commit f52c9f3

Please sign in to comment.