Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH 02/19] objtool: Add fallback from ELF_C_READ_MMAP to ELF_C_READ

20 views
Skip to first unread message

Arnaldo Carvalho de Melo

unread,
Jul 13, 2016, 10:30:34 PM7/13/16
to
From: Arnaldo Carvalho de Melo <ac...@redhat.com>

Not all libelf implementations have this "Please, ELF_C_READ, but use
mmap if possible" elf_begin() cmd, so provide a fallback to plain old
ELF_C_READ.

Case in point: Alpine Linux 3.4.

Cc: Adrian Hunter <adrian...@intel.com>
Cc: David Ahern <dsa...@gmail.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Josh Poimboeuf <jpoi...@redhat.com>
Cc: Namhyung Kim <namh...@kernel.org>
Cc: Wang Nan <wang...@huawei.com>
Link: http://lkml.kernel.org/n/tip-1fctuknraw...@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <ac...@redhat.com>
---
tools/objtool/elf.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index e11f6b69cce6..0d7983ac63ef 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -30,6 +30,13 @@
#include "elf.h"
#include "warn.h"

+/*
+ * Fallback for systems without this "read, mmaping if possible" cmd.
+ */
+#ifndef ELF_C_READ_MMAP
+#define ELF_C_READ_MMAP ELF_C_READ
+#endif
+
struct section *find_section_by_name(struct elf *elf, const char *name)
{
struct section *sec;
--
2.7.4

tip-bot for Arnaldo Carvalho de Melo

unread,
Jul 14, 2016, 3:10:06 AM7/14/16
to
Commit-ID: 774bec3fddcccb0b36f319c6d6e8148dc5e8c937
Gitweb: http://git.kernel.org/tip/774bec3fddcccb0b36f319c6d6e8148dc5e8c937
Author: Arnaldo Carvalho de Melo <ac...@redhat.com>
AuthorDate: Wed, 13 Jul 2016 15:28:51 -0300
Committer: Arnaldo Carvalho de Melo <ac...@redhat.com>
CommitDate: Wed, 13 Jul 2016 15:38:50 -0300

objtool: Add fallback from ELF_C_READ_MMAP to ELF_C_READ

Not all libelf implementations have this "Please, ELF_C_READ, but use
mmap if possible" elf_begin() cmd, so provide a fallback to plain old
ELF_C_READ.

Case in point: Alpine Linux 3.4.

Cc: Adrian Hunter <adrian...@intel.com>
Cc: David Ahern <dsa...@gmail.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Josh Poimboeuf <jpoi...@redhat.com>
Cc: Namhyung Kim <namh...@kernel.org>
Cc: Wang Nan <wang...@huawei.com>
Link: http://lkml.kernel.org/n/tip-1fctuknraw...@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <ac...@redhat.com>
---
tools/objtool/elf.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index e11f6b6..0d7983a 100644
0 new messages