Index: sys/boot/efi/boot1/Makefile =================================================================== --- sys/boot/efi/boot1/Makefile (revision 310792) +++ sys/boot/efi/boot1/Makefile (working copy) @@ -69,6 +69,9 @@ CFLAGS+= -fPIC LDFLAGS+= -Wl,-znocombreloc .endif +.if ${MACHINE_CPUARCH} == "arm" +CFLAGS+= -fPIC +.endif # # Add libstand for the runtime functions used by the compiler - for example Index: sys/boot/efi/libefi/Makefile =================================================================== --- sys/boot/efi/libefi/Makefile (revision 310792) +++ sys/boot/efi/libefi/Makefile (working copy) @@ -35,6 +35,9 @@ .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC -mno-red-zone .endif +.if ${MACHINE_CPUARCH} == "arm" +CFLAGS+= -fPIC +.endif CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} CFLAGS+= -I${.CURDIR}/../../../../lib/libstand Index: sys/boot/efi/loader/arch/arm/Makefile.inc =================================================================== --- sys/boot/efi/loader/arch/arm/Makefile.inc (revision 310792) +++ sys/boot/efi/loader/arch/arm/Makefile.inc (working copy) @@ -3,4 +3,5 @@ SRCS+= exec.c \ start.S +CFLAGS+= -fPIC LOADER_FDT_SUPPORT=yes Index: sys/boot/efi/loader/arch/arm/ldscript.arm =================================================================== --- sys/boot/efi/loader/arch/arm/ldscript.arm (revision 310792) +++ sys/boot/efi/loader/arch/arm/ldscript.arm (working copy) @@ -18,7 +18,7 @@ . = ALIGN(16); .data : { - *(.data *.data.*) + *(.data .data.*) *(.gnu.linkonce.d*) *(.rodata) *(.rodata.*) Index: sys/boot/efi/loader/bootinfo.c =================================================================== --- sys/boot/efi/loader/bootinfo.c (revision 310792) +++ sys/boot/efi/loader/bootinfo.c (working copy) @@ -351,21 +351,6 @@ vm_offset_t dtbp; int dtb_size; #endif -#if defined(__arm__) - vm_offset_t vaddr; - size_t i; - /* - * These metadata addreses must be converted for kernel after - * relocation. - */ - uint32_t mdt[] = { - MODINFOMD_SSYM, MODINFOMD_ESYM, MODINFOMD_KERNEND, - MODINFOMD_ENVP, -#if defined(LOADER_FDT_SUPPORT) - MODINFOMD_DTBP -#endif - }; -#endif howto = bi_getboothowto(args); @@ -440,22 +425,6 @@ md = file_findmetadata(kfp, MODINFOMD_KERNEND); bcopy(&kernend, md->md_data, sizeof kernend); -#if defined(__arm__) - *modulep -= __elfN(relocation_offset); - - /* Do relocation fixup on metadata of each module. */ - for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { - for (i = 0; i < nitems(mdt); i++) { - md = file_findmetadata(xp, mdt[i]); - if (md) { - bcopy(md->md_data, &vaddr, sizeof vaddr); - vaddr -= __elfN(relocation_offset); - bcopy(&vaddr, md->md_data, sizeof vaddr); - } - } - } -#endif - /* Copy module list and metadata. */ (void)bi_copymodules(addr);