Skip to content

ld.lld: error: relocation R_390_64 cannot be used against local symbol; recompile with -fPIC #1993

@nathanchance

Description

@nathanchance

When attempting to build ARCH=s390 defconfig with ld.lld (available after llvm/llvm-project@fe3406e) after applying the patches for #1991 and #1992, there are a series of errors due to the presence of R_390_64 relocations.

$ make -skj"$(nproc)" ARCH=s390 LLVM=1 OBJCOPY=s390x-linux-gnu-objcopy OBJDUMP=s390x-linux-gnu-objdump mrproper defconfig all
ld.lld: error: relocation R_390_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in vmlinux.a(init/do_mounts_initrd.o)
>>> referenced by do_mounts_initrd.c
>>>               init/do_mounts_initrd.o:(__mcount_loc+0x0) in archive vmlinux.a

ld.lld: error: relocation R_390_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in vmlinux.a(init/do_mounts_initrd.o)
>>> referenced by do_mounts_initrd.c
>>>               init/do_mounts_initrd.o:(__mcount_loc+0x8) in archive vmlinux.a

ld.lld: error: relocation R_390_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in vmlinux.a(init/do_mounts_initrd.o)
>>> referenced by do_mounts_initrd.c
>>>               init/do_mounts_initrd.o:(__mcount_loc+0x10) in archive vmlinux.a

ld.lld: error: relocation R_390_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in vmlinux.a(init/do_mounts_initrd.o)
>>> referenced by do_mounts_initrd.c
>>>               init/do_mounts_initrd.o:(__mcount_loc+0x18) in archive vmlinux.a
...

Patch submitted and accepted: https://git.kernel.org/s390/c/55cce52f1cec914870a12e8e9f82659037648cb8

Metadata

Metadata

Assignees

Labels

[ARCH] s390This bug impacts ARCH=s390[BUG] linuxA bug that should be fixed in the mainline kernel.[FIXED][LINUX] 6.9This bug was fixed in Linux 6.9[TOOL] lldThe issue is relevant to LLD linker

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions