Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(RHEL-26133) efi: force .sbat and .sdmagic sections to be 512 bytes #247

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

keszybz
Copy link
Contributor

@keszybz keszybz commented Mar 22, 2024

In https://issues.redhat.com/browse/RHEL-26133 we're having issues with section alignment when objcopy from older bintils is used. IIUC, the short sections are causing the following section to be not aligned. To sidestep the problem, let's make the sections 512 bytes.

$ diff -u <(objdump -h build/src/boot/efi/linuxx64.efi.stub.0) <(objdump -h build/src/boot/efi/linuxx64.efi.stub)|cat --- /proc/self/fd/11	2024-03-22 11:58:47.427094850 +0100 +++ /proc/self/fd/13	2024-03-22 11:58:47.422094852 +0100 @@ -1,5 +1,5 @@

-build/src/boot/efi/linuxx64.efi.stub.0:     file format pei-x86-64
+build/src/boot/efi/linuxx64.efi.stub:     file format pei-x86-64

 Sections:
 Idx Name          Size      VMA               LMA               File off  Algn
@@ -15,7 +15,7 @@
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
   5 .dynsym       00000018  0000000000026000  0000000000026000  0001d000  2**2
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  6 .sbat         000000e6  00000000000289e0  00000000000289e0  0001d200  2**2
+  6 .sbat         00000200  00000000000289e0  00000000000289e0  0001d200  2**2
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  7 .sdmagic      00000038  0000000000028ae0  0000000000028ae0  0001d400  2**2
+  7 .sdmagic      00000200  0000000000028be0  0000000000028be0  0001d400  2**2
                   CONTENTS, ALLOC, LOAD, READONLY, DATA

@github-actions github-actions bot added tracker/missing Formerly needs-bz pr/needs-ci Formerly needs-ci pr/needs-review Formerly needs-review labels Mar 22, 2024
Copy link

github-actions bot commented Mar 22, 2024

Commit validation

Tracker - RHEL-26133

The following commits need an inspection

commit note
3d0ba23 - efi: force .sbat and .sdmagic sections to be 512 bytes Missing upstream reference ‼️

Tracker validation

Failed

🔴 Tracker RHEL-26133 is missing severity

Success

🟢 Tracker RHEL-26133 has set desired product: CentOS Stream 9
🟢 Tracker RHEL-26133 has set desired component: systemd
🟢 Tracker RHEL-26133 has been approved


Pull Request validation

Failed

🔴 Review - Missing review from a member (1 required)

Success

🟢 CI - All checks have passed

@jamacku jamacku added this to the RHEL-9.4.0 milestone Mar 22, 2024
@github-actions github-actions bot removed the pr/needs-ci Formerly needs-ci label Mar 22, 2024
In https://issues.redhat.com/browse/RHEL-26133 we're having issues with section
alignment when objcopy from older bintils is used. IIUC, the short sections are
causing the following section to be not aligned. To sidestep the problem, let's
make the sections 512 bytes.

$ diff -u <(objdump -h build/src/boot/efi/linuxx64.efi.stub.0) <(objdump -h build/src/boot/efi/linuxx64.efi.stub)|cat
--- /proc/self/fd/11	2024-03-22 11:58:47.427094850 +0100
+++ /proc/self/fd/13	2024-03-22 11:58:47.422094852 +0100
@@ -1,5 +1,5 @@

-build/src/boot/efi/linuxx64.efi.stub.0:     file format pei-x86-64
+build/src/boot/efi/linuxx64.efi.stub:     file format pei-x86-64

 Sections:
 Idx Name          Size      VMA               LMA               File off  Algn
@@ -15,7 +15,7 @@
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
   5 .dynsym       00000018  0000000000026000  0000000000026000  0001d000  2**2
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  6 .sbat         000000e6  00000000000289e0  00000000000289e0  0001d200  2**2
+  6 .sbat         00000200  00000000000289e0  00000000000289e0  0001d200  2**2
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
-  7 .sdmagic      00000038  0000000000028ae0  0000000000028ae0  0001d400  2**2
+  7 .sdmagic      00000200  0000000000028be0  0000000000028be0  0001d400  2**2
                   CONTENTS, ALLOC, LOAD, READONLY, DATA

Related: RHEL-26133
@keszybz keszybz force-pushed the rhel-9.4.0-make-sections-bigger branch from 2c869c1 to 3d0ba23 Compare March 22, 2024 12:18
@github-actions github-actions bot removed the tracker/missing Formerly needs-bz label Mar 22, 2024
@github-actions github-actions bot changed the title efi: force .sbat and .sdmagic sections to be 512 bytes (RHEL-26133) efi: force .sbat and .sdmagic sections to be 512 bytes Mar 22, 2024
@github-actions github-actions bot added pr/needs-ci Formerly needs-ci and removed pr/needs-ci Formerly needs-ci labels Mar 22, 2024
@mrc0mmand
Copy link
Member

In #248 I backported the recently introduced upstream test that can be used for testing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants