[1/3] amd: Add relocation type and relocation target type to reloc structure

Submitted by Jan Vesely on June 4, 2019, 2:39 a.m.

Details

Message ID 20190604023917.9194-1-jan.vesely@rutgers.edu
State New
Headers show
Series "Series without cover letter" ( rev: 2 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Jan Vesely June 4, 2019, 2:39 a.m.
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
---
 src/amd/common/ac_binary.c | 2 ++
 src/amd/common/ac_binary.h | 2 ++
 2 files changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/amd/common/ac_binary.c b/src/amd/common/ac_binary.c
index 8f4755ebe16..18dc72c61f0 100644
--- a/src/amd/common/ac_binary.c
+++ b/src/amd/common/ac_binary.c
@@ -102,6 +102,8 @@  static void parse_relocs(Elf *elf, Elf_Data *relocs, Elf_Data *symbols,
 		reloc->offset = rel.r_offset;
 		strncpy(reloc->name, symbol_name, sizeof(reloc->name)-1);
 		reloc->name[sizeof(reloc->name)-1] = 0;
+		reloc->type = GELF_R_TYPE(rel.r_info);
+		reloc->target_type = GELF_ST_TYPE(symbol.st_info);
 	}
 }
 
diff --git a/src/amd/common/ac_binary.h b/src/amd/common/ac_binary.h
index 735e3932055..7541f19fb8e 100644
--- a/src/amd/common/ac_binary.h
+++ b/src/amd/common/ac_binary.h
@@ -34,6 +34,8 @@  extern "C" {
 struct ac_shader_reloc {
 	char name[32];
 	uint64_t offset;
+	int type;
+	int target_type;
 };
 
 struct ac_shader_binary {

Comments