diff options
| author | Khem Raj <raj.khem@gmail.com> | 2020-02-20 08:19:24 -0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2020-02-23 07:49:16 -0800 |
| commit | d280be7d5d6238ef7024c1a89277dabbe7e08c2b (patch) | |
| tree | 786422c5ee1c0bbcf4589359b5bf221c7aa6cf04 | |
| parent | 6b6a18d75c71dc8b26e1de8b3f7d81a8c6e7a526 (diff) | |
| download | meta-openembedded-d280be7d5d6238ef7024c1a89277dabbe7e08c2b.tar.gz | |
oprofile: Fix build with bfd 2.34+
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-kernel/oprofile/oprofile.inc | 1 | ||||
| -rw-r--r-- | meta-oe/recipes-kernel/oprofile/oprofile/0001-Use-new-bfd-APIs-from-2.34.patch | 79 |
2 files changed, 80 insertions, 0 deletions
diff --git a/meta-oe/recipes-kernel/oprofile/oprofile.inc b/meta-oe/recipes-kernel/oprofile/oprofile.inc index a9ee775d45..0e1e2ed8c9 100644 --- a/meta-oe/recipes-kernel/oprofile/oprofile.inc +++ b/meta-oe/recipes-kernel/oprofile/oprofile.inc | |||
| @@ -25,6 +25,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \ | |||
| 25 | file://root-home-dir.patch \ | 25 | file://root-home-dir.patch \ |
| 26 | file://0001-Add-rmb-definition-for-NIOS2-architecture.patch \ | 26 | file://0001-Add-rmb-definition-for-NIOS2-architecture.patch \ |
| 27 | file://0001-replace-sym_iterator-0-with-sym_iterator.patch \ | 27 | file://0001-replace-sym_iterator-0-with-sym_iterator.patch \ |
| 28 | file://0001-Use-new-bfd-APIs-from-2.34.patch \ | ||
| 28 | " | 29 | " |
| 29 | UPSTREAM_CHECK_REGEX = "oprofile-(?P<pver>\d+(\.\d+)+)/" | 30 | UPSTREAM_CHECK_REGEX = "oprofile-(?P<pver>\d+(\.\d+)+)/" |
| 30 | UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/oprofile/files/oprofile/" | 31 | UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/oprofile/files/oprofile/" |
diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0001-Use-new-bfd-APIs-from-2.34.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0001-Use-new-bfd-APIs-from-2.34.patch new file mode 100644 index 0000000000..faf56d1168 --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile/0001-Use-new-bfd-APIs-from-2.34.patch | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | From 34745fb066a266ae6bbb15d08466d4d2cb6a2110 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Thu, 20 Feb 2020 08:11:04 -0800 | ||
| 4 | Subject: [PATCH] Use new bfd APIs from 2.34+ | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 8 | --- | ||
| 9 | libutil++/bfd_support.cpp | 10 +++++----- | ||
| 10 | opjitconv/create_bfd.c | 6 +++--- | ||
| 11 | 2 files changed, 8 insertions(+), 8 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/libutil++/bfd_support.cpp b/libutil++/bfd_support.cpp | ||
| 14 | index fa904839..e53a1530 100644 | ||
| 15 | --- a/libutil++/bfd_support.cpp | ||
| 16 | +++ b/libutil++/bfd_support.cpp | ||
| 17 | @@ -137,7 +137,7 @@ static bool get_build_id(bfd * ibfd, unsigned char * build_id) | ||
| 18 | } | ||
| 19 | } | ||
| 20 | |||
| 21 | - bfd_size_type buildid_sect_size = bfd_section_size(ibfd, sect); | ||
| 22 | + bfd_size_type buildid_sect_size = bfd_section_size(sect); | ||
| 23 | char * contents = (char *) xmalloc(buildid_sect_size); | ||
| 24 | errno = 0; | ||
| 25 | if (!bfd_get_section_contents(ibfd, sect, | ||
| 26 | @@ -188,7 +188,7 @@ bool get_debug_link_info(bfd * ibfd, string & filename, unsigned long & crc32) | ||
| 27 | if (sect == NULL) | ||
| 28 | return false; | ||
| 29 | |||
| 30 | - bfd_size_type debuglink_size = bfd_section_size(ibfd, sect); | ||
| 31 | + bfd_size_type debuglink_size = bfd_section_size(sect); | ||
| 32 | char * contents = (char *) xmalloc(debuglink_size); | ||
| 33 | cverb << vbfd | ||
| 34 | << ".gnu_debuglink section has size " << debuglink_size << endl; | ||
| 35 | @@ -346,7 +346,7 @@ void fixup_linenr(bfd * abfd, asection * section, asymbol ** syms, | ||
| 36 | // first restrict the search on a sensible range of vma, 16 is | ||
| 37 | // an intuitive value based on epilog code look | ||
| 38 | size_t max_search = 16; | ||
| 39 | - size_t section_size = bfd_section_size(abfd, section); | ||
| 40 | + size_t section_size = bfd_section_size(section); | ||
| 41 | if (pc + max_search > section_size) | ||
| 42 | max_search = section_size - pc; | ||
| 43 | |||
| 44 | @@ -819,10 +819,10 @@ find_nearest_line(bfd_info const & b, op_bfd_symbol const & sym, | ||
| 45 | else | ||
| 46 | pc = (sym.value() + offset) - sym.filepos(); | ||
| 47 | |||
| 48 | - if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0) | ||
| 49 | + if ((bfd_section_flags(section) & SEC_ALLOC) == 0) | ||
| 50 | goto fail; | ||
| 51 | |||
| 52 | - if (pc >= bfd_section_size(abfd, section)) | ||
| 53 | + if (pc >= bfd_section_size(section)) | ||
| 54 | goto fail; | ||
| 55 | |||
| 56 | ret = bfd_find_nearest_line(abfd, section, syms, pc, &cfilename, | ||
| 57 | diff --git a/opjitconv/create_bfd.c b/opjitconv/create_bfd.c | ||
| 58 | index 48db143b..5c0e9152 100644 | ||
| 59 | --- a/opjitconv/create_bfd.c | ||
| 60 | +++ b/opjitconv/create_bfd.c | ||
| 61 | @@ -86,12 +86,12 @@ asection * create_section(bfd * abfd, char const * section_name, | ||
| 62 | bfd_perror("bfd_make_section"); | ||
| 63 | goto error; | ||
| 64 | } | ||
| 65 | - bfd_set_section_vma(abfd, section, vma); | ||
| 66 | - if (bfd_set_section_size(abfd, section, size) == FALSE) { | ||
| 67 | + bfd_set_section_vma(section, vma); | ||
| 68 | + if (bfd_set_section_size(section, size) == FALSE) { | ||
| 69 | bfd_perror("bfd_set_section_size"); | ||
| 70 | goto error; | ||
| 71 | } | ||
| 72 | - if (bfd_set_section_flags(abfd, section, flags) == FALSE) { | ||
| 73 | + if (bfd_set_section_flags(section, flags) == FALSE) { | ||
| 74 | bfd_perror("bfd_set_section_flags"); | ||
| 75 | goto error; | ||
| 76 | } | ||
| 77 | -- | ||
| 78 | 2.25.1 | ||
| 79 | |||
