Skip to contentSkip to conversation

boot/syslinux: renumber patches

PATCH New Arnout Vandecappelle (Essensium/Mind) 2 participants 3 messages Aug 15, 2017 – Aug 16, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 boot/syslinux: renumber patches

Also the last two are regenerated, their context has changed due to the patches that have been removed earlier.

---
 ... => 0003-memdisk-Force-ld-output-format-to-32-bits.patch} |  0
 ...atch => 0004-utils-Use-the-host-toolchain-to-build.patch} |  0
 ...ch => 0005-lzo-Use-the-host-toolchain-for-prepcore.patch} |  0
 ...e-VPrint-definition-is-now-part-of-the-exports-of-.patch} |  0
 ...date-the-longjump-calls-to-fit-the-new-declaration.patch} | 12 ++++++------
 ... 0008-efi-wrapper-build-it-with-the-host-toolchain.patch} |  8 ++++----
 6 files changed, 10 insertions(+), 10 deletions(-)
 rename boot/syslinux/{0004-memdisk-Force-ld-output-format-to-32-bits.patch => 0003-memdisk-Force-ld-output-format-to-32-bits.patch} (100%)
 rename boot/syslinux/{0005-utils-Use-the-host-toolchain-to-build.patch => 0004-utils-Use-the-host-toolchain-to-build.patch} (100%)
 rename boot/syslinux/{0006-lzo-Use-the-host-toolchain-for-prepcore.patch => 0005-lzo-Use-the-host-toolchain-for-prepcore.patch} (100%)
 rename boot/syslinux/{0007-The-VPrint-definition-is-now-part-of-the-exports-of-.patch => 0006-The-VPrint-definition-is-now-part-of-the-exports-of-.patch} (100%)
 rename boot/syslinux/{0009-Update-the-longjump-calls-to-fit-the-new-declaration.patch => 0007-Update-the-longjump-calls-to-fit-the-new-declaration.patch} (76%)
 rename boot/syslinux/{0010-efi-wrapper-build-it-with-the-host-toolchain.patch => 0008-efi-wrapper-build-it-with-the-host-toolchain.patch} (81%)
boot/syslinux/0003-memdisk-Force-ld-output-format-to-32-bits.patch renamed from boot/syslinux/0004-memdisk-Force-ld-output-format-to-32-bits.patch +0 -0
similarity index 100%
rename from boot/syslinux/0004-memdisk-Force-ld-output-format-to-32-bits.patch
rename to boot/syslinux/0003-memdisk-Force-ld-output-format-to-32-bits.patch
boot/syslinux/0004-utils-Use-the-host-toolchain-to-build.patch renamed from boot/syslinux/0005-utils-Use-the-host-toolchain-to-build.patch +0 -0
similarity index 100%
rename from boot/syslinux/0005-utils-Use-the-host-toolchain-to-build.patch
rename to boot/syslinux/0004-utils-Use-the-host-toolchain-to-build.patch
boot/syslinux/0005-lzo-Use-the-host-toolchain-for-prepcore.patch renamed from boot/syslinux/0006-lzo-Use-the-host-toolchain-for-prepcore.patch +0 -0
similarity index 100%
rename from boot/syslinux/0006-lzo-Use-the-host-toolchain-for-prepcore.patch
rename to boot/syslinux/0005-lzo-Use-the-host-toolchain-for-prepcore.patch
boot/syslinux/0006-The-VPrint-definition-is-now-part-of-the-exports-of-.patch renamed from boot/syslinux/0007-The-VPrint-definition-is-now-part-of-the-exports-of-.patch +0 -0
similarity index 100%
rename from boot/syslinux/0007-The-VPrint-definition-is-now-part-of-the-exports-of-.patch
rename to boot/syslinux/0006-The-VPrint-definition-is-now-part-of-the-exports-of-.patch
boot/syslinux/0007-Update-the-longjump-calls-to-fit-the-new-declaration.patch renamed from boot/syslinux/0009-Update-the-longjump-calls-to-fit-the-new-declaration.patch +6 -6
similarity index 76%
rename from boot/syslinux/0009-Update-the-longjump-calls-to-fit-the-new-declaration.patch
rename to boot/syslinux/0007-Update-the-longjump-calls-to-fit-the-new-declaration.patch
index cb369981a9..90d0b81f06 100644
@@ -1,4 +1,4 @@
-From db49dbac8a0c563fb6d07c348873e8ae50fee2a6 Mon Sep 17 00:00:00 2001
+From 3bd5c2d951421a89f76b2423e5810862f53486c1 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Beno=C3=AEt=20Allard?= <[email protected]>
 Date: Fri, 9 Jun 2017 11:59:43 +0200
 Subject: [PATCH] Update the longjump calls to fit the new declaration
@@ -12,7 +12,7 @@ Signed-off-by: Beno?t Allard <[email protected]>
  1 file changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/efi/main.c b/efi/main.c
-index fd95f5c..b5383cd 100644
+index 208fee4f..71d31a5c 100644
 --- a/efi/main.c
 +++ b/efi/main.c
 @@ -10,7 +10,6 @@
@@ -23,15 +23,15 @@ index fd95f5c..b5383cd 100644
  
  #include "efi.h"
  #include "fio.h"
-@@ -31,7 +30,7 @@ uint32_t timer_irq;
+@@ -30,7 +29,7 @@ uint32_t timer_irq;
  __export uint8_t KbdMap[256];
  char aux_seg[256];
  
 -static jmp_buf load_error_buf;
 +static jmp_buf *load_error_buf;
  
- EFI_HANDLE image_handle, image_device_handle, mnpsb_handle;
- 
+ static inline EFI_STATUS
+ efi_close_protocol(EFI_HANDLE handle, EFI_GUID *guid, EFI_HANDLE agent,
 -- 
-2.1.4
+2.13.3
 
boot/syslinux/0008-efi-wrapper-build-it-with-the-host-toolchain.patch renamed from boot/syslinux/0010-efi-wrapper-build-it-with-the-host-toolchain.patch +4 -4
similarity index 81%
rename from boot/syslinux/0010-efi-wrapper-build-it-with-the-host-toolchain.patch
rename to boot/syslinux/0008-efi-wrapper-build-it-with-the-host-toolchain.patch
index c8ff9ebe34..9ec12a1791 100644
@@ -1,4 +1,4 @@
-From 755c947e9166366bd1a78efb1e0c7d6e6e2daa07 Mon Sep 17 00:00:00 2001
+From ca8aaded0c7c3900397029bd9520132b62629308 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Beno=C3=AEt=20Allard?= <[email protected]>
 Date: Mon, 12 Jun 2017 14:59:16 +0200
 Subject: [PATCH] efi/wrapper: build it with the host toolchain.
@@ -15,10 +15,10 @@ Signed-off-by: Beno?t Allard <[email protected]>
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/efi/Makefile b/efi/Makefile
-index d3788d9..a17258a 100644
+index d5443bd5..d24d16db 100644
 --- a/efi/Makefile
 +++ b/efi/Makefile
-@@ -78,7 +78,7 @@ syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
+@@ -79,7 +79,7 @@ syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
  #	cp $^ $@
  
  wrapper: wrapper.c
@@ -28,5 +28,5 @@ index d3788d9..a17258a 100644
  #
  # Build the wrapper app and wrap our .so to produce a .efi
 -- 
-2.1.4
+2.13.3
 
Signature · 1 line
2.13.3
#1 lore raw

PATCH 2/2 boot/syslinux: fix i386 bios build with recent binutils

When we use the cross-compiler to build syslinux with a recent binutils version, it fails with:

/builds/arnout/buildroot/output/host/bin/i586-buildroot-linux-uclibc-ld -Bsymbolic -pie -E --hash-style=gnu -T

/builds/arnout/buildroot/output/build/syslinux-6.03/core/i386/syslinux.ld -M -o ldlinux.elf ldlinux.o \
	--start-group libcom32.a --whole-archive /builds/arnout/buildroot/output/build/syslinux-6.03/bios/com32/lib/libcom32core.a libldlinux.a --end-group -N

--no-omagic \
> ldlinux.map
/builds/arnout/buildroot/output/host/bin/i586-buildroot-linux-uclibc-ld: ldlinux.elf: Not enough room for program headers, try linking with -N /builds/arnout/buildroot/output/host/bin/i586-buildroot-linux-uclibc-ld: final link failed: Bad value /builds/arnout/buildroot/output/build/syslinux-6.03/core/Makefile:167: recipe for target 'ldlinux.elf' failed

Backport an upstream patch that reorganises the i386 bios build by removing some symbols and making others hidden. To simplify the backport, an additional patch that also touches the link script is also included - it anyway looks like that patch could be relevant as well.

Partially fixes: https://gitlab.com/arnout/buildroot/-/jobs/28979377

---
The failing ts5x00_defconfig also requires a kernel bump

---
 ...Don-t-try-to-guess-the-sections-alignment.patch | 295 ++++++++++
 .../0010-core-Clean-up-the-i386-bios-build.patch   | 622 +++++++++++++++++++++
 2 files changed, 917 insertions(+)
 create mode 100644 boot/syslinux/0009-bios-Don-t-try-to-guess-the-sections-alignment.patch
 create mode 100644 boot/syslinux/0010-core-Clean-up-the-i386-bios-build.patch
boot/syslinux/0009-bios-Don-t-try-to-guess-the-sections-alignment.patch new file +295 -0
new file mode 100644
index 0000000000..916012f619
@@ -0,0 +1,295 @@
+From 76946dd67bc856eaf4fe69d0826547a794176f78 Mon Sep 17 00:00:00 2001
+From: Sylvain Gault <[email protected]>
+Date: Tue, 29 Sep 2015 04:45:09 +0200
+Subject: [PATCH] bios: Don't try to guess the sections alignment
+
+For the compression / decompression to succeed, the sections layout must
+be the same between the virtual memory and load memory. The section
+alignment was kept in sync by introducing aligment that should be
+greater or equal to the actual section alignment.
+
+This patch compute the load memory addresses of the sections so that
+the layout is the same as the virtual memory addresses.
+
+Signed-off-by: Sylvain Gault <[email protected]>
+Tested-by: poma <[email protected]>
+Signed-off-by: Paulo Alcantara <[email protected]>
+
+Upstream: 0cc9a99e560a2f52bcf052fd85b1efae35ee812f
+Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
+---
+ core/i386/syslinux.ld   | 63 ++++++++++---------------------------------------
+ core/x86_64/syslinux.ld | 63 ++++++++++---------------------------------------
+ 2 files changed, 24 insertions(+), 102 deletions(-)
+
+diff --git a/core/i386/syslinux.ld b/core/i386/syslinux.ld
+index 73904510..92b75b11 100644
+--- a/core/i386/syslinux.ld
++++ b/core/i386/syslinux.ld
+@@ -255,10 +255,9 @@ SECTIONS
+ 	. = 0x100000;
+ 
+ 	__pm_code_start = .;
++	__vma_to_lma = __pm_code_lma - __pm_code_start;
+ 
+-	__text_vma = .;
+-	__text_lma = __pm_code_lma;
+-	.text : AT(__text_lma) {
++	.text : AT(ADDR(.text) + __vma_to_lma) {
+ 		FILL(0x90909090)
+ 		__text_start = .;
+ 		*(.text)
+@@ -266,106 +265,68 @@ SECTIONS
+ 		__text_end = .;
+ 	}
+ 
+-	. = ALIGN(32);
+-
+-	__rodata_vma = .;
+-	__rodata_lma = __rodata_vma + __text_lma - __text_vma;
+-	.rodata : AT(__rodata_lma) {
++	.rodata : AT(ADDR(.rodata) + __vma_to_lma) {
+ 		__rodata_start = .;
+ 		*(.rodata)
+ 		*(.rodata.*)
+ 		__rodata_end = .;
+ 	}
+ 
+-	. = ALIGN(4);
+-
+-	__ctors_vma = .;
+-	__ctors_lma = __ctors_vma + __text_lma - __text_vma;
+-	.ctors : AT(__ctors_lma) {
++	.ctors : AT(ADDR(.ctors) + __vma_to_lma) {
+ 		__ctors_start = .;
+ 		KEEP (*(SORT(.ctors.*)))
+ 		KEEP (*(.ctors))
+ 		__ctors_end = .;
+ 	}
+ 
+-	__dtors_vma = .;
+-	__dtors_lma = __dtors_vma + __text_lma - __text_vma;
+-	.dtors : AT(__dtors_lma) {
++	.dtors : AT(ADDR(.dtors) + __vma_to_lma) {
+ 		__dtors_start = .;
+ 		KEEP (*(SORT(.dtors.*)))
+ 		KEEP (*(.dtors))
+ 		__dtors_end = .;
+ 	}
+ 
+-	. = ALIGN(4);
+-
+-	__dynsym_vma = .;
+-	__dynsym_lma = __dynsym_vma + __text_lma - __text_vma;
+-	.dynsym : AT(__dynsym_lma) {
++	.dynsym : AT(ADDR(.dynsym) + __vma_to_lma) {
+ 		__dynsym_start = .;
+ 		*(.dynsym)
+ 		__dynsym_end = .;
+ 	}
+ 	__dynsym_len = __dynsym_end - __dynsym_start;
+ 
+-	. = ALIGN(4);
+-
+-	__dynstr_vma = .;
+-	__dynstr_lma = __dynstr_vma + __text_lma - __text_vma;
+-	.dynstr : AT(__dynstr_lma) {
++	.dynstr : AT(ADDR(.dynstr) + __vma_to_lma) {
+ 		__dynstr_start = .;
+ 		*(.dynstr)
+ 		__dynstr_end = .;
+ 	}
+ 	__dynstr_len = __dynstr_end - __dynstr_start;
+ 
+-	. = ALIGN(4);
+-
+-	__gnu_hash_vma = .;
+-	__gnu_hash_lma = __gnu_hash_vma + __text_lma - __text_vma;
+-	.gnu.hash : AT(__gnu_hash_lma) {
++	.gnu.hash : AT(ADDR(.gnu.hash) + __vma_to_lma) {
+ 		__gnu_hash_start = .;
+ 		*(.gnu.hash)
+ 		__gnu_hash_end = .;
+ 	}
+ 
+ 
+-	. = ALIGN(4);
+-
+-	__dynlink_vma = .;
+-	__dynlink_lma = __dynlink_vma + __text_lma - __text_vma;
+-	.dynlink : AT(__dynlink_lma) {
++	.dynlink : AT(ADDR(.dynlink) + __vma_to_lma) {
+ 		__dynlink_start = .;
+ 		*(.dynlink)
+ 		__dynlink_end = .;
+ 	}
+ 
+-	. = ALIGN(4);
+-
+-	__got_vma = .;
+-	__got_lma = __got_vma + __text_lma - __text_vma;
+-	.got : AT(__got_lma) {
++	.got : AT(ADDR(.got) + __vma_to_lma) {
+ 		__got_start = .;
+ 		KEEP (*(.got.plt))
+ 		KEEP (*(.got))
+ 		__got_end = .;
+ 	}
+ 
+-	. = ALIGN(4);
+-
+-	__dynamic_vma = .;
+-	__dynamic_lma = __dynamic_vma + __text_lma - __text_vma;
+-	.dynamic : AT(__dynamic_lma) {
++	.dynamic : AT(ADDR(.dynamic) + __vma_to_lma) {
+ 		__dynamic_start = .;
+ 		*(.dynamic)
+ 		__dynamic_end = .;
+ 	}
+ 
+-	. = ALIGN(32);
+-
+-	__data_vma = .;
+-	__data_lma = __data_vma + __text_lma - __text_vma;
+-	.data : AT(__data_lma) {
++	.data : AT(ADDR(.data) + __vma_to_lma) {
+ 		__data_start = .;
+ 		*(.data)
+ 		*(.data.*)
+diff --git a/core/x86_64/syslinux.ld b/core/x86_64/syslinux.ld
+index bf815c46..70c6e00a 100644
+--- a/core/x86_64/syslinux.ld
++++ b/core/x86_64/syslinux.ld
+@@ -255,10 +255,9 @@ SECTIONS
+ 	. = 0x100000;
+ 
+ 	__pm_code_start = .;
++	__vma_to_lma = __pm_code_lma - __pm_code_start;
+ 
+-	__text_vma = .;
+-	__text_lma = __pm_code_lma;
+-	.text : AT(__text_lma) {
++	.text : AT(ADDR(.text) + __vma_to_lma) {
+ 		FILL(0x90909090)
+ 		__text_start = .;
+ 		*(.text)
+@@ -266,106 +265,68 @@ SECTIONS
+ 		__text_end = .;
+ 	}
+ 
+-	. = ALIGN(32);
+-
+-	__rodata_vma = .;
+-	__rodata_lma = __rodata_vma + __text_lma - __text_vma;
+-	.rodata : AT(__rodata_lma) {
++	.rodata : AT(ADDR(.rodata) + __vma_to_lma) {
+ 		__rodata_start = .;
+ 		*(.rodata)
+ 		*(.rodata.*)
+ 		__rodata_end = .;
+ 	}
+ 
+-	. = ALIGN(4);
+-
+-	__ctors_vma = .;
+-	__ctors_lma = __ctors_vma + __text_lma - __text_vma;
+-	.ctors : AT(__ctors_lma) {
++	.ctors : AT(ADDR(.ctors) + __vma_to_lma) {
+ 		__ctors_start = .;
+ 		KEEP (*(SORT(.ctors.*)))
+ 		KEEP (*(.ctors))
+ 		__ctors_end = .;
+ 	}
+ 
+-	__dtors_vma = .;
+-	__dtors_lma = __dtors_vma + __text_lma - __text_vma;
+-	.dtors : AT(__dtors_lma) {
++	.dtors : AT(ADDR(.dtors) + __vma_to_lma) {
+ 		__dtors_start = .;
+ 		KEEP (*(SORT(.dtors.*)))
+ 		KEEP (*(.dtors))
+ 		__dtors_end = .;
+ 	}
+ 
+-	. = ALIGN(4);
+-
+-	__dynsym_vma = .;
+-	__dynsym_lma = __dynsym_vma + __text_lma - __text_vma;
+-	.dynsym : AT(__dynsym_lma) {
++	.dynsym : AT(ADDR(.dynsym) + __vma_to_lma) {
+ 		__dynsym_start = .;
+ 		*(.dynsym)
+ 		__dynsym_end = .;
+ 	}
+ 	__dynsym_len = __dynsym_end - __dynsym_start;
+ 
+-	. = ALIGN(4);
+-
+-	__dynstr_vma = .;
+-	__dynstr_lma = __dynstr_vma + __text_lma - __text_vma;
+-	.dynstr : AT(__dynstr_lma) {
++	.dynstr : AT(ADDR(.dynstr) + __vma_to_lma) {
+ 		__dynstr_start = .;
+ 		*(.dynstr)
+ 		__dynstr_end = .;
+ 	}
+ 	__dynstr_len = __dynstr_end - __dynstr_start;
+ 
+-	. = ALIGN(4);
+-
+-	__gnu_hash_vma = .;
+-	__gnu_hash_lma = __gnu_hash_vma + __text_lma - __text_vma;
+-	.gnu.hash : AT(__gnu_hash_lma) {
++	.gnu.hash : AT(ADDR(.gnu.hash) + __vma_to_lma) {
+ 		__gnu_hash_start = .;
+ 		*(.gnu.hash)
+ 		__gnu_hash_end = .;
+ 	}
+ 
+ 
+-	. = ALIGN(4);
+-
+-	__dynlink_vma = .;
+-	__dynlink_lma = __dynlink_vma + __text_lma - __text_vma;
+-	.dynlink : AT(__dynlink_lma) {
++	.dynlink : AT(ADDR(.dynlink) + __vma_to_lma) {
+ 		__dynlink_start = .;
+ 		*(.dynlink)
+ 		__dynlink_end = .;
+ 	}
+ 
+-	. = ALIGN(4);
+-
+-	__got_vma = .;
+-	__got_lma = __got_vma + __text_lma - __text_vma;
+-	.got : AT(__got_lma) {
++	.got : AT(ADDR(.got) + __vma_to_lma) {
+ 		__got_start = .;
+ 		KEEP (*(.got.plt))
+ 		KEEP (*(.got))
+ 		__got_end = .;
+ 	}
+ 
+-	. = ALIGN(4);
+-
+-	__dynamic_vma = .;
+-	__dynamic_lma = __dynamic_vma + __text_lma - __text_vma;
+-	.dynamic : AT(__dynamic_lma) {
++	.dynamic : AT(ADDR(.dynamic) + __vma_to_lma) {
+ 		__dynamic_start = .;
+ 		*(.dynamic)
+ 		__dynamic_end = .;
+ 	}
+ 
+-	. = ALIGN(32);
+-
+-	__data_vma = .;
+-	__data_lma = __data_vma + __text_lma - __text_vma;
+-	.data : AT(__data_lma) {
++	.data : AT(ADDR(.data) + __vma_to_lma) {
+ 		__data_start = .;
+ 		*(.data)
+ 		*(.data.*)
+-- 
+2.13.3
+
boot/syslinux/0010-core-Clean-up-the-i386-bios-build.patch new file +622 -0

622 lines not on this page · raw message

Signature · 1 line
2.13.3
#2 lore raw

PATCH 1/2 boot/syslinux: renumber patches

In reply to Arnout Vandecappelle (Essensium/Mind)

Hello,

Quoted 4 lines · Arnout Vandecappelle (Essensium/Mind)

Also the last two are regenerated, their context has changed due to the patches that have been removed earlier.

Quoted 14 lines
---
 ... => 0003-memdisk-Force-ld-output-format-to-32-bits.patch} |  0
 ...atch => 0004-utils-Use-the-host-toolchain-to-build.patch} |  0
 ...ch => 0005-lzo-Use-the-host-toolchain-for-prepcore.patch} |  0
 ...e-VPrint-definition-is-now-part-of-the-exports-of-.patch} |  0
 ...date-the-longjump-calls-to-fit-the-new-declaration.patch} | 12 ++++++------
 ... 0008-efi-wrapper-build-it-with-the-host-toolchain.patch} |  8 ++++----
 6 files changed, 10 insertions(+), 10 deletions(-)
 rename boot/syslinux/{0004-memdisk-Force-ld-output-format-to-32-bits.patch => 0003-memdisk-Force-ld-output-format-to-32-bits.patch} (100%)
 rename boot/syslinux/{0005-utils-Use-the-host-toolchain-to-build.patch => 0004-utils-Use-the-host-toolchain-to-build.patch} (100%)
 rename boot/syslinux/{0006-lzo-Use-the-host-toolchain-for-prepcore.patch => 0005-lzo-Use-the-host-toolchain-for-prepcore.patch} (100%)
 rename boot/syslinux/{0007-The-VPrint-definition-is-now-part-of-the-exports-of-.patch => 0006-The-VPrint-definition-is-now-part-of-the-exports-of-.patch} (100%)
 rename boot/syslinux/{0009-Update-the-longjump-calls-to-fit-the-new-declaration.patch => 0007-Update-the-longjump-calls-to-fit-the-new-declaration.patch} (76%)
 rename boot/syslinux/{0010-efi-wrapper-build-it-with-the-host-toolchain.patch => 0008-efi-wrapper-build-it-with-the-host-toolchain.patch} (81%)

Both patches applied to master. I tested, and indeed before your patches, building syslinux fails with binutils 2.29, while it works after your patches.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com