提交 9da2f584 编写于 作者: N Nicholas Piggin 提交者: Michal Marek

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: NAnton Blanchard <anton@samba.org>
Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
Signed-off-by: NMichal Marek <mmarek@suse.com>
上级 7e441fe7
...@@ -424,7 +424,7 @@ quiet_cmd_export_list = EXPORTS $@ ...@@ -424,7 +424,7 @@ quiet_cmd_export_list = EXPORTS $@
cmd_export_list = $(OBJDUMP) -h $< | \ cmd_export_list = $(OBJDUMP) -h $< | \
sed -ne '/___ksymtab/{s/.*+/$(ref_prefix)/;s/ .*/)/;p}' >$(ksyms-lds);\ sed -ne '/___ksymtab/{s/.*+/$(ref_prefix)/;s/ .*/)/;p}' >$(ksyms-lds);\
rm -f $(dummy-object);\ 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);\ $(LD) $(ld_flags) -r -o $@ -T $(ksyms-lds) $(dummy-object);\
rm $(dummy-object) $(ksyms-lds) rm $(dummy-object) $(ksyms-lds)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册