lkml.org 
[lkml]   [2020]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 1/4] objtool: Move object file loading out of check
From
Date


On 7/30/20 3:09 PM, Josh Poimboeuf wrote:
> 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().
>

Sure, I'll update that.

Thanks,

--
Julien Thierry

\
 
 \ /
  Last update: 2020-07-30 16:43    [W:0.054 / U:5.960 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site