History

objtool: Add elf_create_file()

Add interface to enable the creation of a new ELF file.

Josh Poimboeuf committed 1 year ago

Commit 03c19a91 parent 2c05ca03 files · +147 −4Browse files

Showing the changes to tools/objtool/include/objtool (1 of 3 files). Show all

Unified · Split

tools/objtool/include/objtool/elf.h+3−2
@@ -94,7 +94,7 @@ struct elf { · 93 unmodified lines
9494 GElf_Ehdr ehdr;
9595 int fd;
9696 bool changed;
97− const char *name;
97+ const char *name, *tmp_name;
9898 unsigned int num_files;
9999 struct list_head sections;
100100 unsigned long num_relocs;
@@ -116,6 +116,7 @@ struct elf { · 15 unmodified lines
116116 };
117117
118118 struct elf *elf_open_read(const char *name, int flags);
119+struct elf *elf_create_file(GElf_Ehdr *ehdr, const char *name);
119120
120121 struct section *elf_create_section(struct elf *elf, const char *name,
121122 size_t size, size_t entsize,
@@ -165,7 +166,7 @@ int elf_write_insn(struct elf *elf, struct section *sec, unsigned long offset, · 43 unmodified lines
165166 unsigned int len, const char *insn);
166167
167168 int elf_write(struct elf *elf);
168−void elf_close(struct elf *elf);
169+int elf_close(struct elf *elf);
169170
170171 struct section *find_section_by_name(const struct elf *elf, const char *name);
171172 struct symbol *find_func_by_offset(struct section *sec, unsigned long offset);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t