Lines Matching refs:result
48 prepare_text_output (AsmCtx_t *result) in prepare_text_output() argument
50 if (result->fd == -1) in prepare_text_output()
51 result->out.file = stdout; in prepare_text_output()
54 result->out.file = fdopen (result->fd, "a"); in prepare_text_output()
55 if (result->out.file == NULL) in prepare_text_output()
57 close (result->fd); in prepare_text_output()
58 free (result); in prepare_text_output()
59 result = NULL; in prepare_text_output()
62 __fsetlocking (result->out.file, FSETLOCKING_BYCALLER); in prepare_text_output()
65 return result; in prepare_text_output()
70 prepare_binary_output (AsmCtx_t *result, Ebl *ebl) in prepare_binary_output() argument
76 result->out.elf = elf_begin (result->fd, ELF_C_WRITE_MMAP, NULL); in prepare_binary_output()
77 if (result->out.elf == NULL) in prepare_binary_output()
80 unlink (result->tmp_fname); in prepare_binary_output()
81 close (result->fd); in prepare_binary_output()
82 free (result); in prepare_binary_output()
89 if (gelf_newehdr (result->out.elf, class) == 0) in prepare_binary_output()
92 ehdr = gelf_getehdr (result->out.elf, &ehdr_mem); in prepare_binary_output()
109 (void) gelf_update_ehdr (result->out.elf, ehdr); in prepare_binary_output()
112 result->section_list = NULL; in prepare_binary_output()
115 asm_symbol_tab_init (&result->symbol_tab, 67); in prepare_binary_output()
116 result->nsymbol_tab = 0; in prepare_binary_output()
118 result->section_strtab = ebl_strtabinit (true); in prepare_binary_output()
119 result->symbol_strtab = ebl_strtabinit (true); in prepare_binary_output()
122 result->groups = NULL; in prepare_binary_output()
123 result->ngroups = 0; in prepare_binary_output()
125 return result; in prepare_binary_output()
141 AsmCtx_t *result in asm_begin() local
143 if (result == NULL) in asm_begin()
147 rwlock_init (result->lock); in asm_begin()
152 result->fname = stpcpy (mempcpy (result->tmp_fname, fname, fname_len), in asm_begin()
154 memcpy (result->fname, fname, fname_len + 1); in asm_begin()
157 result->fd = mkstemp (result->tmp_fname); in asm_begin()
158 if (result->fd == -1) in asm_begin()
161 free (result); in asm_begin()
168 result->fd = -1; in asm_begin()
171 result->tempsym_count = 0; in asm_begin()
174 result->textp = textp; in asm_begin()
176 result = prepare_text_output (result); in asm_begin()
178 result = prepare_binary_output (result, ebl); in asm_begin()
180 return result; in asm_begin()