svn commit: r241036 - stable/9/sys/boot/common
Andreas Tobler
andreast at FreeBSD.org
Fri Sep 28 17:36:01 UTC 2012
Author: andreast
Date: Fri Sep 28 17:36:00 2012
New Revision: 241036
URL: http://svn.freebsd.org/changeset/base/241036
Log:
MFC r240782:
Implement elfN(reloc) for powerpc. With this change the kernel is now able to
resolve dependencies of modules at boot time and load additional modules when
needed.
Modified:
stable/9/sys/boot/common/reloc_elf.c
Modified: stable/9/sys/boot/common/reloc_elf.c
==============================================================================
--- stable/9/sys/boot/common/reloc_elf.c Fri Sep 28 17:34:34 2012 (r241035)
+++ stable/9/sys/boot/common/reloc_elf.c Fri Sep 28 17:36:00 2012 (r241036)
@@ -193,6 +193,31 @@ __elfN(reloc)(struct elf_file *ef, symad
}
return (0);
+#elif defined(__powerpc__)
+ Elf_Size w;
+ const Elf_Rela *rela;
+
+ switch (reltype) {
+ case ELF_RELOC_RELA:
+ rela = reldata;
+ if (relbase + rela->r_offset >= dataaddr &&
+ relbase + rela->r_offset < dataaddr + len) {
+ switch (ELF_R_TYPE(rela->r_info)) {
+ case R_PPC_RELATIVE:
+ w = relbase + rela->r_addend;
+ bcopy(&w, (u_char *)data + (relbase +
+ rela->r_offset - dataaddr), sizeof(w));
+ break;
+ default:
+ printf("\nunhandled relocation type %u\n",
+ (u_int)ELF_R_TYPE(rela->r_info));
+ return (EFTYPE);
+ }
+ }
+ break;
+ }
+
+ return (0);
#else
return (EOPNOTSUPP);
#endif
More information about the svn-src-stable-9
mailing list