https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81863
--- Comment #17 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> --- (In reply to Arnd Bergmann from comment #0) > Created attachment 41989 [details] > preprocessed linux/mm/shmem.c file, compressed > > I ran into a few files in the linux kernel that while building with > -mword-relocations still produce 16-bit relocations, leading to a link error > with -fpie, e.g. > > arm-linux-gnueabi-ld: mm/page_alloc.o: relocation R_ARM_THM_MOVW_ABS_NC > against `vm_zone_stat' can not be used when making a shared object; > recompile with -fPIC > > With the attached source file: > > $ arm-linux-gnueabi-gcc-7.1.1 -Wall mm/shmem.i -O2 -march=armv7-a -c > -Wno-unused -Wno-pointer-sign -fno-strict-aliasing -mword-relocations > $ objdump -dr mm/shmem.o | grep R_ARM_MOVW > 326c: R_ARM_MOVW_ABS_NC vm_committed_as > 34b8: R_ARM_MOVW_ABS_NC vm_committed_as > 357c: R_ARM_MOVW_ABS_NC vm_committed_as Could you put some instructions in this BZ about how you build and test the kernel to get these errors ? I'm happy to try something before I post the patch rather than going backwards and forwards.