libdwarf: Add aarch64 relocation support

Reviewed by:	andrew, rpaulo
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D1817
This commit is contained in:
Ed Maste 2015-02-11 14:59:35 +00:00
parent 5dbbe22ac8
commit 84c37881c6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278580
2 changed files with 9 additions and 0 deletions

View file

@ -439,6 +439,7 @@ enum Dwarf_ISA {
DW_ISA_SPARC,
DW_ISA_X86,
DW_ISA_X86_64,
DW_ISA_AARCH64,
DW_ISA_MAX
};

View file

@ -35,6 +35,8 @@ _dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64)
assert(dbg != NULL);
switch (dbg->dbgp_isa) {
case DW_ISA_AARCH64:
return (is64 ? R_AARCH64_ABS64 : R_AARCH64_ABS32);
case DW_ISA_X86:
return (R_386_32);
case DW_ISA_X86_64:
@ -62,6 +64,12 @@ _dwarf_get_reloc_size(Dwarf_Debug dbg, Dwarf_Unsigned rel_type)
switch (dbg->dbg_machine) {
case EM_NONE:
break;
case EM_AARCH64:
if (rel_type == R_AARCH64_ABS32)
return (4);
else if (rel_type == R_AARCH64_ABS64)
return (8);
break;
case EM_ARM:
if (rel_type == R_ARM_ABS32)
return (4);