1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
From 2564787ea16dbcfc1ebcccbebe17a2e85d433574 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
Date: Tue, 3 Mar 2020 22:20:30 +0100
Subject: [PATCH] Fix up bfd_get_section_* macros due to binutils 2.34 update.
See
https://wiki.gentoo.org/wiki/Binutils_2.34_porting_notes/undefined_reference_to_bfd_get_section_*
for more details.
---
src/merger/common/bfd_manager.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/src/merger/common/bfd_manager.c b/src/merger/common/bfd_manager.c
index 86777b7..79d49d0 100644
--- a/src/merger/common/bfd_manager.c
+++ b/src/merger/common/bfd_manager.c
@@ -233,34 +233,24 @@ asymbol **BFDmanager_getDefaultSymbols (void)
*/
static void BFDmanager_findAddressInSection (bfd * abfd, asection * section, PTR data)
{
-#if HAVE_BFD_GET_SECTION_SIZE || HAVE_BFD_GET_SECTION_SIZE_BEFORE_RELOC
bfd_size_type size;
-#endif
bfd_vma vma;
BFDmanager_symbolInfo_t *symdata = (BFDmanager_symbolInfo_t*) data;
if (symdata->found)
return;
- if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0)
+ if ((bfd_section_flags (section) & SEC_ALLOC) == 0)
return;
- vma = bfd_get_section_vma (abfd, section);;
+ vma = bfd_section_vma (section);;
if (symdata->pc < vma)
return;
-#if HAVE_BFD_GET_SECTION_SIZE
- size = bfd_get_section_size (section);
- if (symdata->pc >= vma + size)
- return;
-#elif HAVE_BFD_GET_SECTION_SIZE_BEFORE_RELOC
- size = bfd_get_section_size_before_reloc (section);
+ size = bfd_section_size (section);
if (symdata->pc >= vma + size)
return;
-#else
- /* Do nothing? */
-#endif
symdata->found = bfd_find_nearest_line (abfd, section, symdata->symbols,
symdata->pc - vma, &symdata->filename, &symdata->function,
--
2.25.1
|