Home | History | Annotate | Download | only in common

Lines Matching refs:binary

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