objtool: Add fallback from ELF_C_READ_MMAP to ELF_C_READ
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 13 Jul 2016 18:28:51 +0000 (15:28 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 13 Jul 2016 18:38:50 +0000 (15:38 -0300)
commit774bec3fddcccb0b36f319c6d6e8148dc5e8c937
tree063f78e8496f744cac164ad665b672c4e3927c98
parent2a00f026a15d161b47ba3d3417d0fec5193468c3
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>
tools/objtool/elf.c