Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 May 2016 11:58:55 +0000 (UTC)
From:      Ruslan Bukin <br@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r300675 - head/contrib/elftoolchain/libdwarf
Message-ID:  <201605251158.u4PBwtpC006569@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: br
Date: Wed May 25 11:58:55 2016
New Revision: 300675
URL: https://svnweb.freebsd.org/changeset/base/300675

Log:
  Add relocation support for RISC-V.
  
  Reviewed by:	emaste
  Sponsored by:	DARPA, AFRL
  Sponsored by:	HEIF5
  Differential Revision:	https://reviews.freebsd.org/D6559

Modified:
  head/contrib/elftoolchain/libdwarf/libdwarf.h
  head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c

Modified: head/contrib/elftoolchain/libdwarf/libdwarf.h
==============================================================================
--- head/contrib/elftoolchain/libdwarf/libdwarf.h	Wed May 25 10:09:23 2016	(r300674)
+++ head/contrib/elftoolchain/libdwarf/libdwarf.h	Wed May 25 11:58:55 2016	(r300675)
@@ -440,6 +440,7 @@ enum Dwarf_ISA {
 	DW_ISA_X86,
 	DW_ISA_X86_64,
 	DW_ISA_AARCH64,
+	DW_ISA_RISCV,
 	DW_ISA_MAX
 };
 

Modified: head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c
==============================================================================
--- head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c	Wed May 25 10:09:23 2016	(r300674)
+++ head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c	Wed May 25 11:58:55 2016	(r300675)
@@ -54,6 +54,8 @@ _dwarf_get_reloc_type(Dwarf_P_Debug dbg,
 		return (R_ARM_ABS32);
 	case DW_ISA_MIPS:
 		return (is64 ? R_MIPS_64 : R_MIPS_32);
+	case DW_ISA_RISCV:
+		return (is64 ? R_RISCV_64 : R_RISCV_32);
 	case DW_ISA_IA64:
 		return (is64 ? R_IA_64_DIR64LSB : R_IA_64_DIR32LSB);
 	default:
@@ -106,6 +108,12 @@ _dwarf_get_reloc_size(Dwarf_Debug dbg, D
 		else if (rel_type == R_MIPS_64)
 			return (8);
 		break;
+	case EM_RISCV:
+		if (rel_type == R_RISCV_32)
+			return (4);
+		else if (rel_type == R_RISCV_64)
+			return (8);
+		break;
 	case EM_IA_64:
 		if (rel_type == R_IA_64_SECREL32LSB)
 			return (4);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605251158.u4PBwtpC006569>