Home | History | Annotate | Download | only in common

Lines Matching refs:binary

44 				struct ac_shader_binary *binary)
58 binary->global_symbol_offsets = CALLOC(symbol_count, sizeof(uint64_t));
67 binary->global_symbol_offsets[binary->global_symbol_count] =
72 for (i = binary->global_symbol_count; i > 0; --i) {
73 uint64_t lhs = binary->global_symbol_offsets[i - 1];
74 uint64_t rhs = binary->global_symbol_offsets[i];
78 binary->global_symbol_offsets[i] = lhs;
79 binary->global_symbol_offsets[i - 1] = rhs;
81 ++binary->global_symbol_count;
87 struct ac_shader_binary *binary)
91 if (!relocs || !symbols || !binary->reloc_count) {
94 binary->relocs = CALLOC(binary->reloc_count,
96 for (i = 0; i < binary->reloc_count; i++) {
100 struct ac_shader_reloc *reloc = &binary->relocs[i];
113 struct ac_shader_binary *binary)
145 binary->code_size = section_data->d_size;
146 binary->code = MALLOC(binary->code_size * sizeof(unsigned char));
147 memcpy(binary->code, section_data->d_buf, binary->code_size);
150 binary->config_size = section_data->d_size;
151 binary->config = MALLOC(binary->config_size * sizeof(unsigned char));
152 memcpy(binary->config, section_data->d_buf, binary->config_size);
156 binary->disasm_string = strndup(section_data->d_buf,
160 binary->rodata_size = section_data->d_size;
161 binary->rodata = MALLOC(binary->rodata_size * sizeof(unsigned char));
162 memcpy(binary->rodata, section_data->d_buf, binary->rodata_size);
166 parse_symbol_table(symbols, &section_header, binary);
169 binary->reloc_count = section_header.sh_size /
174 parse_relocs(elf, relocs, symbols, symbol_sh_link, binary);
182 if (binary->global_symbol_count) {
183 binary->config_size_per_symbol =
184 binary->config_size / binary->global_symbol_count;
186 binary->global_symbol_count = 1;
187 binary->config_size_per_symbol = binary->config_size;
193 const struct ac_shader_binary *binary,
197 for (i = 0; i < binary->global_symbol_count; ++i) {
198 if (binary->global_symbol_offsets[i] == symbol_offset) {
199 unsigned offset = i * binary->config_size_per_symbol;
200 return binary->config + offset;
203 return binary->config;
213 void ac_shader_binary_read_config(struct ac_shader_binary *binary,
219 ac_shader_binary_config_start(binary, symbol_offset);
225 for (i = 0; i < binary->reloc_count; i++) {
226 const struct ac_shader_reloc *reloc = &binary->relocs[i];
235 for (i = 0; i < binary->config_size_per_symbol; i+= 8) {