Add interface to enable the creation of a new ELF file.
Showing the changes to tools/objtool/include/objtool (1 of 3 files). Show all
Unified · Split
| @@ -94,7 +94,7 @@ struct elf { · 93 unmodified lines | ||
| 94 | 94 | GElf_Ehdr ehdr; |
| 95 | 95 | int fd; |
| 96 | 96 | bool changed; |
| 97 | − const char *name; | |
| 97 | + const char *name, *tmp_name; | |
| 98 | 98 | unsigned int num_files; |
| 99 | 99 | struct list_head sections; |
| 100 | 100 | unsigned long num_relocs; |
| @@ -116,6 +116,7 @@ struct elf { · 15 unmodified lines | ||
| 116 | 116 | }; |
| 117 | 117 | |
| 118 | 118 | struct elf *elf_open_read(const char *name, int flags); |
| 119 | +struct elf *elf_create_file(GElf_Ehdr *ehdr, const char *name); | |
| 119 | 120 | |
| 120 | 121 | struct section *elf_create_section(struct elf *elf, const char *name, |
| 121 | 122 | 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 | ||
| 165 | 166 | unsigned int len, const char *insn); |
| 166 | 167 | |
| 167 | 168 | int elf_write(struct elf *elf); |
| 168 | −void elf_close(struct elf *elf); | |
| 169 | +int elf_close(struct elf *elf); | |
| 169 | 170 | |
| 170 | 171 | struct section *find_section_by_name(const struct elf *elf, const char *name); |
| 171 | 172 | struct symbol *find_func_by_offset(struct section *sec, unsigned long offset); |