Lines Matching full:binary

40 				struct ac_shader_binary *binary)  in parse_symbol_table()  argument
54 binary->global_symbol_offsets = CALLOC(symbol_count, sizeof(uint64_t)); in parse_symbol_table()
63 binary->global_symbol_offsets[binary->global_symbol_count] = in parse_symbol_table()
68 for (i = binary->global_symbol_count; i > 0; --i) { in parse_symbol_table()
69 uint64_t lhs = binary->global_symbol_offsets[i - 1]; in parse_symbol_table()
70 uint64_t rhs = binary->global_symbol_offsets[i]; in parse_symbol_table()
74 binary->global_symbol_offsets[i] = lhs; in parse_symbol_table()
75 binary->global_symbol_offsets[i - 1] = rhs; in parse_symbol_table()
77 ++binary->global_symbol_count; in parse_symbol_table()
83 struct ac_shader_binary *binary) in parse_relocs() argument
87 if (!relocs || !symbols || !binary->reloc_count) { in parse_relocs()
90 binary->relocs = CALLOC(binary->reloc_count, in parse_relocs()
92 for (i = 0; i < binary->reloc_count; i++) { in parse_relocs()
96 struct ac_shader_reloc *reloc = &binary->relocs[i]; in parse_relocs()
109 struct ac_shader_binary *binary) in ac_elf_read() argument
143 binary->code_size = section_data->d_size; in ac_elf_read()
144 binary->code = MALLOC(binary->code_size * sizeof(unsigned char)); in ac_elf_read()
145 memcpy(binary->code, section_data->d_buf, binary->code_size); in ac_elf_read()
148 binary->config_size = section_data->d_size; in ac_elf_read()
149 if (!binary->config_size) { in ac_elf_read()
154 binary->config = MALLOC(binary->config_size * sizeof(unsigned char)); in ac_elf_read()
155 memcpy(binary->config, section_data->d_buf, binary->config_size); in ac_elf_read()
159 binary->disasm_string = strndup(section_data->d_buf, in ac_elf_read()
163 binary->rodata_size = section_data->d_size; in ac_elf_read()
164 binary->rodata = MALLOC(binary->rodata_size * sizeof(unsigned char)); in ac_elf_read()
165 memcpy(binary->rodata, section_data->d_buf, binary->rodata_size); in ac_elf_read()
169 parse_symbol_table(symbols, &section_header, binary); in ac_elf_read()
172 binary->reloc_count = section_header.sh_size / in ac_elf_read()
177 parse_relocs(elf, relocs, symbols, symbol_sh_link, binary); in ac_elf_read()
185 if (binary->global_symbol_count) { in ac_elf_read()
186 binary->config_size_per_symbol = in ac_elf_read()
187 binary->config_size / binary->global_symbol_count; in ac_elf_read()
189 binary->global_symbol_count = 1; in ac_elf_read()
190 binary->config_size_per_symbol = binary->config_size; in ac_elf_read()
196 const struct ac_shader_binary *binary, in ac_shader_binary_config_start() argument
200 for (i = 0; i < binary->global_symbol_count; ++i) { in ac_shader_binary_config_start()
201 if (binary->global_symbol_offsets[i] == symbol_offset) { in ac_shader_binary_config_start()
202 unsigned offset = i * binary->config_size_per_symbol; in ac_shader_binary_config_start()
203 return binary->config + offset; in ac_shader_binary_config_start()
206 return binary->config; in ac_shader_binary_config_start()
216 void ac_shader_binary_read_config(struct ac_shader_binary *binary, in ac_shader_binary_read_config() argument
223 ac_shader_binary_config_start(binary, symbol_offset); in ac_shader_binary_read_config()
232 for (i = 0; i < binary->reloc_count; i++) { in ac_shader_binary_read_config()
233 const struct ac_shader_reloc *reloc = &binary->relocs[i]; in ac_shader_binary_read_config()
243 for (i = 0; i < binary->config_size_per_symbol; i+= 8) { in ac_shader_binary_read_config()