r276047 added -march=armv7 to the default arm compile options. Among other things, this allows the compiler to generate movw/movt sequences to load a constant into a register. Using those instructions results in relocation types R_ARM_MOVW_ABS_NC and R_ARM_MOVT_ABS being emitted, and when those types appear in a .ko module they are not being handled correctly by ld. The lower 16 bits of the relocated value are correct, but the upper 16 bits (used in the movt instruction) are always zero. This leads to a variety of wild-pointer crashes in the loaded module. This problem may affect shared libraries in userland too, but we don't currently add the -march=armv7 flag there, it's used only for kernel and module builds now.
A commit references this bug: Author: ian Date: Fri Jan 2 03:20:14 UTC 2015 New revision: 276525 URL: https://svnweb.freebsd.org/changeset/base/276525 Log: Put in a workaround for bug 196407 (arm modules cause crashes & panics). When we started compiling the kernel with -march=armv7 the compiler started emitting new types of relocation info which are incompatible with the shared-lib file format used by .ko modules. This workaround prevents the compiler from emitting the instruction sequences that require the new relocs. This amounts to using an undocumented internal compiler flag, so this is just a temporary workaround while we look for a good fix. PR: 196407 Changes: head/sys/conf/kmod.mk
Apparently resolved in r276525. Thank you for your submission.
Re-open. This problem is not fixed. There was a temporary workaround added to kernel and module compiles, but there is currently no proper solution and no workaround in place for userland compiles with -march=armv7
Pieces of the fix for this were commited (but I forgot to cite the PR in the commits)... r292964 - Fix sign-extension for movw/movt relocs. r292870 - When linking, don't generate .plt entries for movw/movt relocs. r292993 - Don't generate movw/movt instructions when building libstand since the bootloader self_reloc() code can't handle it (same fix as the original fix for modules). That leaves one pending issue I know of, which is the need to prevent generation of movt/movw when compiling the rest of ubldr other than libstand. This is still pending, awaiting input from others.
Some svn archeology shows that the last piece of the fixes for this was committed in r295421, so this can now be closed.