xen: Fix EFI buildid alignment
PATCH 1/1 xen: Fix EFI buildid alignment
Old binutils get confused about .buildid overlapping (in VA space) with earlier section. That confusion results in weird errors down the road, like this one:
objcopy: xen.efi: Data Directory size (1c) exceeds space left in section (8)
While the bug is fixed in later binutils version, force alignment of the buildid to avoid overlapping and make it work with older versions too. This can be reverted once toolchain base is raised at or above binutils 2.36.
---
While the actual bug apparently is in binutils, the commit mentioned in
Fixes: tag introduced part that triggers that bug.
--- xen/arch/x86/xen.lds.S | 2 ++ 1 file changed, 2 insertions(+)
xen/arch/x86/xen.lds.S +2 -0
@@ -171,6 +171,8 @@ SECTIONS __note_gnu_build_id_end = .; } PHDR(note) PHDR(text) #elif defined(BUILD_ID_EFI) + /* Workaround bug in binutils < 2.38 */ + . = ALIGN(32); DECL_SECTION(.buildid) { __note_gnu_build_id_start = .; *(.buildid)
Signature · 1 line
2.51.0
Quoted 11 lines · Marek Marczykowski-Górecki
Old binutils get confused about .buildid overlapping (in VA space) with earlier section. That confusion results in weird errors down the road, like this one:
objcopy: xen.efi: Data Directory size (1c) exceeds space left in section (8)
While the bug is fixed in later binutils version, force alignment of the buildid to avoid overlapping and make it work with older versions too. This can be reverted once toolchain base is raised at or above binutils 2.36.
Quoted 5 lines
Signed-off-by Marek Marczykowski-Górecki <[email protected]>Fixes eee5909e9d1e ("x86/EFI: use less crude a way of generating the build ID")
We typically put these tags in the other order. I can fix on commit.
Quoted 12 lines
---
While the actual bug apparently is in binutils, the commit mentioned in
Fixes: tag introduced part that triggers that bug.--- xen/arch/x86/xen.lds.S | 2 ++ 1 file changed, 2 insertions(+)xen/arch/x86/xen.lds.S +0
-0
xen/arch/x86/xen.lds.S SECTIONS · line 174
Quoted 4 lines
xen/arch/x86/xen.lds.S +1
-0@@ -171,6 +171,8 @@ SECTIONS __note_gnu_build_id_end = .; } PHDR(note) PHDR(text) #elif defined(BUILD_ID_EFI) + /* Workaround bug in binutils < 2.38 */
... this says 2.38, but the commit message says 2.36. Which one is it?
~Andrew
Quoted 4 lines
xen/arch/x86/xen.lds.S +1
-0+ . = ALIGN(32); DECL_SECTION(.buildid) { __note_gnu_build_id_start = .; *(.buildid)
Quoted 29 lines · Andrew Cooper
Quoted 11 lines · Marek Marczykowski-Górecki
Old binutils get confused about .buildid overlapping (in VA space) with earlier section. That confusion results in weird errors down the road, like this one:
objcopy: xen.efi: Data Directory size (1c) exceeds space left in section (8)
While the bug is fixed in later binutils version, force alignment of the buildid to avoid overlapping and make it work with older versions too. This can be reverted once toolchain base is raised at or above binutils 2.36.
Quoted 5 lines
Signed-off-by Marek Marczykowski-Górecki <[email protected]>Fixes eee5909e9d1e ("x86/EFI: use less crude a way of generating the build ID")We typically put these tags in the other order. I can fix on commit.
Reviewed-by Andrew Cooper <[email protected]>, although...Quoted 7 lines
---
While the actual bug apparently is in binutils, the commit mentioned in
Fixes: tag introduced part that triggers that bug.--- xen/arch/x86/xen.lds.S | 2 ++ 1 file changed, 2 insertions(+)
Quoted 11 lines
xen/arch/x86/xen.lds.S SECTIONS · line 174
Quoted 9 lines
xen/arch/x86/xen.lds.S +1
-0@@ -171,6 +171,8 @@ SECTIONS __note_gnu_build_id_end = .; } PHDR(note) PHDR(text) #elif defined(BUILD_ID_EFI) + /* Workaround bug in binutils < 2.38 */... this says 2.38, but the commit message says 2.36. Which one is it?
2.36
Quoted 7 lines
~Andrew
Quoted 4 lines
xen/arch/x86/xen.lds.S +1
-0+ . = ALIGN(32); DECL_SECTION(.buildid) { __note_gnu_build_id_start = .; *(.buildid)
Signature · 3 lines
Best Regards, Marek Marczykowski-Górecki Invisible Things Lab
Quoted 39 lines · Marek Marczykowski-Górecki
Quoted 28 lines · Andrew Cooper
Quoted 11 lines · Marek Marczykowski-Górecki
Old binutils get confused about .buildid overlapping (in VA space) with earlier section. That confusion results in weird errors down the road, like this one:
objcopy: xen.efi: Data Directory size (1c) exceeds space left in section (8)
While the bug is fixed in later binutils version, force alignment of the buildid to avoid overlapping and make it work with older versions too. This can be reverted once toolchain base is raised at or above binutils 2.36.
Quoted 5 lines
Signed-off-by Marek Marczykowski-Górecki <[email protected]>Fixes eee5909e9d1e ("x86/EFI: use less crude a way of generating the build ID")We typically put these tags in the other order. I can fix on commit.
Reviewed-by Andrew Cooper <[email protected]>, although...Quoted 7 lines
---
While the actual bug apparently is in binutils, the commit mentioned in
Fixes: tag introduced part that triggers that bug.--- xen/arch/x86/xen.lds.S | 2 ++ 1 file changed, 2 insertions(+)Quoted 10 lines
xen/arch/x86/xen.lds.S SECTIONS · line 174
Quoted 9 lines
xen/arch/x86/xen.lds.S +1
-0@@ -171,6 +171,8 @@ SECTIONS __note_gnu_build_id_end = .; } PHDR(note) PHDR(text) #elif defined(BUILD_ID_EFI) + /* Workaround bug in binutils < 2.38 */... this says 2.38, but the commit message says 2.36. Which one is it?
Quoted 1 line
2.36
Thanks. I'll adjust on commit.
~Andrew