This will simplify implementations of binary shaders.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
struct r600_perfcounters;
struct radeon_shader_reloc {
- char *name;
+ char name[32];
uint64_t offset;
};
symbol_name = elf_strptr(elf, symbol_sh_link, symbol.st_name);
reloc->offset = rel.r_offset;
- reloc->name = strdup(symbol_name);
+ strncpy(reloc->name, symbol_name, sizeof(reloc->name)-1);
+ reloc->name[sizeof(reloc->name)-1] = 0;
}
}
void radeon_shader_binary_free_relocs(struct radeon_shader_reloc *relocs,
unsigned reloc_count)
{
- unsigned i;
- for (i = 0; i < reloc_count; i++) {
- FREE(relocs[i].name);
- }
FREE(relocs);
}