Commit 8e144797 authored by Michael Forney's avatar Michael Forney Committed by Thomas Gleixner

objtool: Rename elf_open() to prevent conflict with libelf from elftoolchain

The elftoolchain version of libelf has a function named elf_open().

The function name isn't quite accurate anyway, since it also reads all
the ELF data.  Rename it to elf_read(), which is more accurate.

[ jpoimboe: rename to elf_read(); write commit description ]
Signed-off-by: default avatarMichael Forney <mforney@mforney.org>
Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/7ce2d1b35665edf19fd0eb6fbc0b17b81a48e62f.1562793604.git.jpoimboe@redhat.com
parent 3c3ea503
...@@ -2407,7 +2407,7 @@ int check(const char *_objname, bool orc) ...@@ -2407,7 +2407,7 @@ int check(const char *_objname, bool orc)
objname = _objname; objname = _objname;
file.elf = elf_open(objname, orc ? O_RDWR : O_RDONLY); file.elf = elf_read(objname, orc ? O_RDWR : O_RDONLY);
if (!file.elf) if (!file.elf)
return 1; return 1;
......
...@@ -401,7 +401,7 @@ static int read_relas(struct elf *elf) ...@@ -401,7 +401,7 @@ static int read_relas(struct elf *elf)
return 0; return 0;
} }
struct elf *elf_open(const char *name, int flags) struct elf *elf_read(const char *name, int flags)
{ {
struct elf *elf; struct elf *elf;
Elf_Cmd cmd; Elf_Cmd cmd;
......
...@@ -74,7 +74,7 @@ struct elf { ...@@ -74,7 +74,7 @@ struct elf {
}; };
struct elf *elf_open(const char *name, int flags); struct elf *elf_read(const char *name, int flags);
struct section *find_section_by_name(struct elf *elf, const char *name); struct section *find_section_by_name(struct elf *elf, const char *name);
struct symbol *find_symbol_by_offset(struct section *sec, unsigned long offset); struct symbol *find_symbol_by_offset(struct section *sec, unsigned long offset);
struct symbol *find_symbol_by_name(struct elf *elf, const char *name); struct symbol *find_symbol_by_name(struct elf *elf, const char *name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment