From: Andrew Stubbs Date: Thu, 22 Oct 2020 12:27:47 +0000 (+0100) Subject: Fix early-debug relocations X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d24a4c8c4256cc287ebf4ad80368b4f1edb1733e;p=gcc.git 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. --- 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 ();