[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200730140936.uvw73r655356lhtm@treble>
Date: Thu, 30 Jul 2020 09:09:36 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Julien Thierry <jthierry@...hat.com>
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org,
mhelsley@...are.com, mbenes@...e.cz
Subject: Re: [PATCH v3 1/4] objtool: Move object file loading out of check
On Thu, Jul 30, 2020 at 10:41:40AM +0100, Julien Thierry wrote:
> +struct objtool_file *objtool_setup_file(const char *_objname)
> +{
> + if (objname) {
> + if (strcmp(objname, _objname)) {
> + WARN("won't handle more than one file at a time");
> + return NULL;
> + }
> + return &file;
> + }
> + objname = _objname;
> +
> + file.elf = elf_open_read(objname, O_RDWR);
> + if (!file.elf)
> + return NULL;
> +
> + INIT_LIST_HEAD(&file.insn_list);
> + hash_init(file.insn_hash);
> + file.c_file = find_section_by_name(file.elf, ".comment");
> + file.ignore_unreachables = no_unreachable;
> + file.hints = false;
> +
> + return &file;
> +}
How about calling it objtool_open_read()? It's (sort of) a wrapper
around elf_open_read().
--
Josh
Powered by blists - more mailing lists