Re: [Xen-devel] [PATCH v3 3/3] xen/x86: declare the efi symbol as weak
On Thu, Jul 12, 2018 at 06:37:33PM +0200, Roger Pau Monné wrote: > On Thu, Jul 12, 2018 at 01:35:14PM +0200, Daniel Kiper wrote: > > On Wed, Jul 11, 2018 at 05:34:50PM +0200, Roger Pau Monne wrote: > > > This allows removing the DEFINED conditional in the linker script, and > > > fixes compilation with lld: > > > > s/lld/LLVM linker/? > > > > Could you mention the version of LLVM linker in the commit message? > > And I am still not sure why do you insist on this patch series. > > IIRC you have told us that both issues will be fixed in LLVM. > > Right, but I have no idea when lld 7.0.0 will be released, much less > when it will be merged into FreeBSD base system. Please add something like that to the commit messages of both patches. Daniel ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v3 3/3] xen/x86: declare the efi symbol as weak
On Thu, Jul 12, 2018 at 01:35:14PM +0200, Daniel Kiper wrote: > On Wed, Jul 11, 2018 at 05:34:50PM +0200, Roger Pau Monne wrote: > > This allows removing the DEFINED conditional in the linker script, and > > fixes compilation with lld: > > s/lld/LLVM linker/? > > Could you mention the version of LLVM linker in the commit message? > And I am still not sure why do you insist on this patch series. > IIRC you have told us that both issues will be fixed in LLVM. Right, but I have no idea when lld 7.0.0 will be released, much less when it will be merged into FreeBSD base system. > > ld-melf_x86_64_fbsd -T xen.lds -N prelink.o --build-id=sha1 \ > > /root/src/xen/xen/common/symbols-dummy.o -o > > /root/src/xen/xen/.xen-syms.0 > > ld: error: xen.lds:233: symbol not found: efi > > > > Signed-off-by: Roger Pau Monné > > With this patch applied ld from binutils 2.22 complains in this way: > > ld-melf_x86_64 -T xen.lds -N prelink.o --build-id=sha1 \ > xen/common/symbols-dummy.o -o xen/.xen-syms.0 > prelink.o: In function `acpi_os_get_root_pointer': > xen/drivers/acpi/osl.c:73:(.init.text+0x192e9): relocation truncated to fit: > R_X86_64_PC32 against undefined symbol `efi' > xen/drivers/acpi/osl.c:75:(.init.text+0x192f6): relocation truncated to fit: > R_X86_64_PC32 against undefined symbol `efi' > prelink.o: In function `efi_check_config': > xen/arch/x86/mpparse.c:702:(.init.text+0x238ce): relocation truncated to fit: > R_X86_64_PC32 against undefined symbol `efi' > xen/arch/x86/mpparse.c:706:(.init.text+0x238f2): relocation truncated to fit: > R_X86_64_PC32 against undefined symbol `efi' > prelink.o: In function `dmi_efi_iterate': > xen/arch/x86/dmi_scan.c:377:(.init.text+0x3666f): relocation truncated to > fit: R_X86_64_PC32 against undefined symbol `efi' > xen/arch/x86/dmi_scan.c:391:(.init.text+0x366d7): relocation truncated to > fit: R_X86_64_PC32 against undefined symbol `efi' > xen/arch/x86/dmi_scan.c:400:(.init.text+0x36735): relocation truncated to > fit: R_X86_64_PC32 against undefined symbol `efi' > xen/arch/x86/dmi_scan.c:414:(.init.text+0x367b1): relocation truncated to > fit: R_X86_64_PC32 against undefined symbol `efi' Hm, weird. I've tested with ld 2.17.50 and it worked fine. Seems like gitlab is able to reproduce this, so let me see if I can solve it. Thanks, Roger. ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v3 3/3] xen/x86: declare the efi symbol as weak
>>> On 12.07.18 at 13:35, wrote: > On Wed, Jul 11, 2018 at 05:34:50PM +0200, Roger Pau Monne wrote: >> This allows removing the DEFINED conditional in the linker script, and >> fixes compilation with lld: > > s/lld/LLVM linker/? > > Could you mention the version of LLVM linker in the commit message? > And I am still not sure why do you insist on this patch series. > IIRC you have told us that both issues will be fixed in LLVM. > >> ld-melf_x86_64_fbsd -T xen.lds -N prelink.o --build-id=sha1 \ >> /root/src/xen/xen/common/symbols-dummy.o -o /root/src/xen/xen/.xen-syms.0 >> ld: error: xen.lds:233: symbol not found: efi >> >> Signed-off-by: Roger Pau Monné > > With this patch applied ld from binutils 2.22 complains in this way: > > ld-melf_x86_64 -T xen.lds -N prelink.o --build-id=sha1 \ > xen/common/symbols-dummy.o -o xen/.xen-syms.0 > prelink.o: In function `acpi_os_get_root_pointer': > xen/drivers/acpi/osl.c:73:(.init.text+0x192e9): relocation truncated to fit: > R_X86_64_PC32 against undefined symbol `efi' > xen/drivers/acpi/osl.c:75:(.init.text+0x192f6): relocation truncated to fit: > R_X86_64_PC32 against undefined symbol `efi' > prelink.o: In function `efi_check_config': > xen/arch/x86/mpparse.c:702:(.init.text+0x238ce): relocation truncated to fit: > R_X86_64_PC32 against undefined symbol `efi' > xen/arch/x86/mpparse.c:706:(.init.text+0x238f2): relocation truncated to fit: > R_X86_64_PC32 against undefined symbol `efi' > prelink.o: In function `dmi_efi_iterate': > xen/arch/x86/dmi_scan.c:377:(.init.text+0x3666f): relocation truncated to > fit: R_X86_64_PC32 against undefined symbol `efi' > xen/arch/x86/dmi_scan.c:391:(.init.text+0x366d7): relocation truncated to > fit: R_X86_64_PC32 against undefined symbol `efi' > xen/arch/x86/dmi_scan.c:400:(.init.text+0x36735): relocation truncated to > fit: R_X86_64_PC32 against undefined symbol `efi' > xen/arch/x86/dmi_scan.c:414:(.init.text+0x367b1): relocation truncated to > fit: R_X86_64_PC32 against undefined symbol `efi' Oh, I could indeed have thought of this risk. Jan ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v3 3/3] xen/x86: declare the efi symbol as weak
On Wed, Jul 11, 2018 at 05:34:50PM +0200, Roger Pau Monne wrote: > This allows removing the DEFINED conditional in the linker script, and > fixes compilation with lld: s/lld/LLVM linker/? Could you mention the version of LLVM linker in the commit message? And I am still not sure why do you insist on this patch series. IIRC you have told us that both issues will be fixed in LLVM. > ld-melf_x86_64_fbsd -T xen.lds -N prelink.o --build-id=sha1 \ > /root/src/xen/xen/common/symbols-dummy.o -o /root/src/xen/xen/.xen-syms.0 > ld: error: xen.lds:233: symbol not found: efi > > Signed-off-by: Roger Pau Monné With this patch applied ld from binutils 2.22 complains in this way: ld-melf_x86_64 -T xen.lds -N prelink.o --build-id=sha1 \ xen/common/symbols-dummy.o -o xen/.xen-syms.0 prelink.o: In function `acpi_os_get_root_pointer': xen/drivers/acpi/osl.c:73:(.init.text+0x192e9): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `efi' xen/drivers/acpi/osl.c:75:(.init.text+0x192f6): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `efi' prelink.o: In function `efi_check_config': xen/arch/x86/mpparse.c:702:(.init.text+0x238ce): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `efi' xen/arch/x86/mpparse.c:706:(.init.text+0x238f2): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `efi' prelink.o: In function `dmi_efi_iterate': xen/arch/x86/dmi_scan.c:377:(.init.text+0x3666f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `efi' xen/arch/x86/dmi_scan.c:391:(.init.text+0x366d7): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `efi' xen/arch/x86/dmi_scan.c:400:(.init.text+0x36735): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `efi' xen/arch/x86/dmi_scan.c:414:(.init.text+0x367b1): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `efi' Everything works with binutils 2.28. Daniel ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
[Xen-devel] [PATCH v3 3/3] xen/x86: declare the efi symbol as weak
This allows removing the DEFINED conditional in the linker script, and fixes compilation with lld: ld-melf_x86_64_fbsd -T xen.lds -N prelink.o --build-id=sha1 \ /root/src/xen/xen/common/symbols-dummy.o -o /root/src/xen/xen/.xen-syms.0 ld: error: xen.lds:233: symbol not found: efi Signed-off-by: Roger Pau Monné --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Daniel Kiper --- xen/arch/x86/xen.lds.S | 2 -- xen/include/xen/efi.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 326e885402..9fa40a6d48 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -304,8 +304,6 @@ SECTIONS } :text #endif - efi = DEFINED(efi) ? efi : .; - /* Sections to be discarded */ /DISCARD/ : { *(.exit.text) diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h index 44b7d3ec3a..5678df72f9 100644 --- a/xen/include/xen/efi.h +++ b/xen/include/xen/efi.h @@ -21,7 +21,7 @@ struct efi { unsigned long smbios3; /* SMBIOS v3 table */ }; -extern struct efi efi; +extern struct efi __weak efi; #ifndef __ASSEMBLY__ -- 2.17.1 ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel