diff mbox series

trace: handle binutils bfd.h breakage

Message ID 1579079403-Ieb75a110fccf593e92e6e0d83bf02ba2e0c86d96@changeid
State Accepted
Headers show
Series trace: handle binutils bfd.h breakage | expand

Commit Message

Johannes Berg Jan. 15, 2020, 9:10 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Some things in bfd.h that we use were renamed, and in the
case of bfd_get_section_vma() a parameter was dropped.
Work around this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 src/utils/trace.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Jouni Malinen Jan. 20, 2020, 7:37 p.m. UTC | #1
On Wed, Jan 15, 2020 at 10:10:03AM +0100, Johannes Berg wrote:
> Some things in bfd.h that we use were renamed, and in the
> case of bfd_get_section_vma() a parameter was dropped.
> Work around this.

Thanks, applied.
diff mbox series

Patch

diff --git a/src/utils/trace.c b/src/utils/trace.c
index 40843432050e..8f12da87bb1b 100644
--- a/src/utils/trace.c
+++ b/src/utils/trace.c
@@ -146,6 +146,17 @@  struct bfd_data {
 	unsigned int line;
 };
 
+/*
+ * binutils removed the bfd parameter and renamed things but
+ * those were macros so we can detect their absence.
+ * Cf. https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=fd3619828e94a24a92cddec42cbc0ab33352eeb4;hp=5dfda3562a69686c43aad4fb0269cc9d5ec010d5
+ */
+#ifndef bfd_get_section_vma
+#define bfd_get_section_vma(bfd, section) bfd_section_vma(section)
+#endif
+#ifndef bfd_get_section_size
+#define bfd_get_section_size bfd_section_size
+#endif
 
 static void find_addr_sect(bfd *abfd, asection *section, void *obj)
 {