https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81863
Bug ID: 81863 Summary: [7 regression] -mword-relocations is unreliable Product: gcc Version: 7.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: arnd at linaro dot org Target Milestone: --- Created attachment 41989 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41989&action=edit 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