https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63793
--- Comment #17 from howarth at bromo dot med.uc.edu --- The only other place that looks promising is... case UNSPEC_GOTOFF: /* Refuse GOTOFF in 64bit mode since it is always 64bit when used. While ABI specify also 32bit relocation but we don't produce it in small PIC model at all. */ if ((GET_CODE (XVECEXP (disp, 0, 0)) == SYMBOL_REF || GET_CODE (XVECEXP (disp, 0, 0)) == LABEL_REF) && !TARGET_64BIT) return !TARGET_PECOFF && gotoff_operand (XVECEXP (disp, 0, 0), Pmode); return false; in gcc/config/i386/i386.c. As I understand the problem, we need to expand the existing code to treat -mcmodel=small in the current manner but -mcmodel=medium/large needs to switch to GOT.