From d24a4c8c4256cc287ebf4ad80368b4f1edb1733e Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Thu, 22 Oct 2020 13:27:47 +0100 Subject: [PATCH] Fix early-debug relocations The relocation symbols were inadvertantly wiped when the type was set in mkoffload. gcc/ChangeLog * config/gcn/mkoffload.c (copy_early_debug_info): Don't wipe relocation symbols. --- gcc/config/gcn/mkoffload.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gcc/config/gcn/mkoffload.c b/gcc/config/gcn/mkoffload.c index f7589a5a78c..fad0fb346ec 100644 --- a/gcc/config/gcn/mkoffload.c +++ b/gcc/config/gcn/mkoffload.c @@ -336,19 +336,24 @@ copy_early_debug_info (const char *infile, const char *outfile) { case R_X86_64_32: case R_X86_64_32S: - reloc->r_info = R_AMDGPU_ABS32; + reloc->r_info = ELF32_R_INFO(ELF32_R_SYM(reloc->r_info), + R_AMDGPU_ABS32); break; case R_X86_64_PC32: - reloc->r_info = R_AMDGPU_REL32; + reloc->r_info = ELF32_R_INFO(ELF32_R_SYM(reloc->r_info), + R_AMDGPU_REL32); break; case R_X86_64_PC64: - reloc->r_info = R_AMDGPU_REL64; + reloc->r_info = ELF32_R_INFO(ELF32_R_SYM(reloc->r_info), + R_AMDGPU_REL64); break; case R_X86_64_64: - reloc->r_info = R_AMDGPU_ABS64; + reloc->r_info = ELF32_R_INFO(ELF32_R_SYM(reloc->r_info), + R_AMDGPU_ABS64); break; case R_X86_64_RELATIVE: - reloc->r_info = R_AMDGPU_RELATIVE64; + reloc->r_info = ELF32_R_INFO(ELF32_R_SYM(reloc->r_info), + R_AMDGPU_RELATIVE64); break; default: gcc_unreachable (); -- 2.30.2