diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-07-13 21:28:51 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-07-13 21:38:50 +0300 |
commit | 774bec3fddcccb0b36f319c6d6e8148dc5e8c937 (patch) | |
tree | 063f78e8496f744cac164ad665b672c4e3927c98 /tools/objtool | |
parent | 2a00f026a15d161b47ba3d3417d0fec5193468c3 (diff) | |
download | linux-774bec3fddcccb0b36f319c6d6e8148dc5e8c937.tar.xz |
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.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-1fctuknrawgoi5xqon4mu9dv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/objtool')
-rw-r--r-- | tools/objtool/elf.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |