History

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.

Nicholas Piggin committed 9 years ago

Commit 9da2f581 parent 7e441fe1 file · +1 −1Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/Makefile.build+1−1
@@ -424,7 +424,7 @@ quiet_cmd_export_list = EXPORTS $@ · 423 unmodified lines
424cmd_export_list = $(OBJDUMP) -h $< | \424cmd_export_list = $(OBJDUMP) -h $< | \
425 sed -ne '/___ksymtab/{s/.*+/$(ref_prefix)/;s/ .*/)/;p}' >$(ksyms-lds);\425 sed -ne '/___ksymtab/{s/.*+/$(ref_prefix)/;s/ .*/)/;p}' >$(ksyms-lds);\
426 rm -f $(dummy-object);\426 rm -f $(dummy-object);\
427 $(AR) rcs$(KBUILD_ARFLAGS) $(dummy-object);\427 echo | $(CC) $(a_flags) -c -o $(dummy-object) -x assembler -;\
428 $(LD) $(ld_flags) -r -o $@ -T $(ksyms-lds) $(dummy-object);\428 $(LD) $(ld_flags) -r -o $@ -T $(ksyms-lds) $(dummy-object);\
429 rm $(dummy-object) $(ksyms-lds)429 rm $(dummy-object) $(ksyms-lds)
430 430