svn commit: r330131 - head/stand/common
Ian Lepore
ian at FreeBSD.org
Wed Feb 28 21:51:52 UTC 2018
Author: ian
Date: Wed Feb 28 21:51:51 2018
New Revision: 330131
URL: https://svnweb.freebsd.org/changeset/base/330131
Log:
Fix module loading on arm after the metadata.c unification in r329190.
Arm modules need an additional address fixup not needed by other platforms.
Modified:
head/stand/common/metadata.c
Modified: head/stand/common/metadata.c
==============================================================================
--- head/stand/common/metadata.c Wed Feb 28 21:49:44 2018 (r330130)
+++ head/stand/common/metadata.c Wed Feb 28 21:51:51 2018 (r330131)
@@ -265,6 +265,7 @@ md_copymodules(vm_offset_t addr, int kern64)
struct preloaded_file *fp;
struct file_metadata *md;
uint64_t scratch64;
+ uint32_t scratch32;
int c;
c = addr != 0;
@@ -281,7 +282,11 @@ md_copymodules(vm_offset_t addr, int kern64)
scratch64 = fp->f_size;
MOD_SIZE(addr, scratch64, c);
} else {
- MOD_ADDR(addr, fp->f_addr, c);
+ scratch32 = fp->f_addr;
+#ifdef __arm__
+ scratch32 -= __elfN(relocation_offset);
+#endif
+ MOD_ADDR(addr, scratch32, c);
MOD_SIZE(addr, fp->f_size, c);
}
for (md = fp->f_metadata; md != NULL; md = md->md_next) {
More information about the svn-src-all
mailing list