i386: Switch to PIC kernel modules

It seems since the last llvm project update, the lld linker has started
creating a PLT dependent kernel module object files.

Reviewed by:		kib, jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D41088
This commit is contained in:
Dmitry Chagin 2023-07-19 21:21:04 +03:00
parent c721694a1c
commit c84617e87a
2 changed files with 2 additions and 1 deletions

View File

@ -166,7 +166,7 @@ CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
.endif
.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" || \
${MACHINE_CPUARCH} == "powerpc"
${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "i386"
CFLAGS+= -fPIC
.endif

View File

@ -244,6 +244,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data,
break;
case R_386_GLOB_DAT: /* S */
case R_386_JMP_SLOT: /* S */
error = lookup(lf, symidx, 1, &addr);
if (error != 0)
return (-1);