From 2440272307cd28dea66a46c282e0f053690521ca Mon Sep 17 00:00:00 2001 From: chrsm Date: Sat, 22 Feb 2020 12:48:33 -0800 Subject: [PATCH] [common] fix build for newer versions of binutils binutils has changed several macros. Added ifdef to allow building with stable and bleeding edge versions. refs #232 --- common/src/platform/linux/crash.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/src/platform/linux/crash.c b/common/src/platform/linux/crash.c index 218d65f5..1272b42e 100644 --- a/common/src/platform/linux/crash.c +++ b/common/src/platform/linux/crash.c @@ -98,10 +98,18 @@ static void load_symbols() static bool lookup_address(bfd_vma pc, const char ** filename, const char ** function, unsigned int * line, unsigned int * discriminator) { +#ifdef bfd_get_section_flags if ((bfd_get_section_flags(crash.fd, crash.section) & SEC_ALLOC) == 0) +#else + if ((bfd_section_flags(crash.section) & SEC_ALLOC) == 0) +#endif return false; +#ifdef bfd_get_section_size bfd_size_type size = bfd_get_section_size(crash.section); +#else + bfd_size_type size = bfd_section_size(crash.section); +#endif if (pc >= size) return false; @@ -230,4 +238,4 @@ bool installCrashHandler(const char * exe) return true; } -#endif \ No newline at end of file +#endif