From: Nicholas Piggin Date: Wed, 23 Nov 2016 16:41:40 +0000 (+1100) Subject: kbuild: improve linker compatibility with lib-ksyms.o build X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9da2f584b54fa4bf0df4db220cd89b6c7e691c6e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git kbuild: improve linker compatibility with lib-ksyms.o build lib-ksyms.o is created by linking an empty input file with a linker script containing the interesting bits. Currently the empty input file is an archive containing nothing, however this causes the gold linker to segfault. I have opened a bug against gold https://sourceware.org/bugzilla/show_bug.cgi?id=20767 However this can be worked around by assembling an empty file to link with instead. The resulting lib-ksyms.o is slightly larger (seemingly due to empty .text, .data, .bss setions added), but final linked output should not be changed. Reported-by: Anton Blanchard Signed-off-by: Nicholas Piggin Signed-off-by: Michal Marek --- diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 9807a8115896..fb6a5ee1edec 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -424,7 +424,7 @@ quiet_cmd_export_list = EXPORTS $@ cmd_export_list = $(OBJDUMP) -h $< | \ sed -ne '/___ksymtab/{s/.*+/$(ref_prefix)/;s/ .*/)/;p}' >$(ksyms-lds);\ rm -f $(dummy-object);\ - $(AR) rcs$(KBUILD_ARFLAGS) $(dummy-object);\ + echo | $(CC) $(a_flags) -c -o $(dummy-object) -x assembler -;\ $(LD) $(ld_flags) -r -o $@ -T $(ksyms-lds) $(dummy-object);\ rm $(dummy-object) $(ksyms-lds)