Author: andrew
Date: Wed Jan 13 21:34:15 2016
New Revision: 293852
URL: https://svnweb.freebsd.org/changeset/base/293852

Log:
  Add support for relocating AArch64 modules to kldxref. This fixes an error
  message where it fails to read the module as the unrelocated addresses
  are zero.
  
  Sponsored by: ABT Systems Ltd

Added:
  head/usr.sbin/kldxref/ef_aarch64.c
     - copied, changed from r293737, head/usr.sbin/kldxref/ef_powerpc.c

Copied and modified: head/usr.sbin/kldxref/ef_aarch64.c (from r293737, 
head/usr.sbin/kldxref/ef_powerpc.c)
==============================================================================
--- head/usr.sbin/kldxref/ef_powerpc.c  Tue Jan 12 09:03:39 2016        
(r293737, copy source)
+++ head/usr.sbin/kldxref/ef_aarch64.c  Wed Jan 13 21:34:15 2016        
(r293852)
@@ -60,15 +60,18 @@ ef_reloc(struct elf_file *ef, const void
        rtype = ELF_R_TYPE(rela->r_info);
        symidx = ELF_R_SYM(rela->r_info);
 
-        if ((char *)where < (char *)dest || (char *)where >= (char *)dest + 
len)
+       if ((char *)where < (char *)dest || (char *)where >= (char *)dest + len)
                 return (0);
 
        switch(rtype) {
-       case R_PPC_RELATIVE: /* word32 B + A */
+       case R_AARCH64_RELATIVE:
                *where = relbase + addend;
                break;
+       case R_AARCH64_ABS64:
+               break;
        default:
-               warnx("unhandled relocation type %d", rtype);
+               warnx("unhandled relocation type %lu", rtype);
+               break;
        }
        return (0);
 }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to