All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Serbinenko <phcoder@gmail.com>
To: grub-devel@gnu.org
Cc: Vladimir Serbinenko <phcoder@gmail.com>
Subject: [PATCH 3/3] pe2elf: Set correct flag for relocation sections
Date: Thu,  1 May 2025 20:34:21 +0000	[thread overview]
Message-ID: <20250501203527.725790-4-phcoder@gmail.com> (raw)
In-Reply-To: <20250501203527.725790-1-phcoder@gmail.com>

Without this flag GRUB ignores the relocation section leading to a crash

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
---
 util/grub-pe2elf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/util/grub-pe2elf.c b/util/grub-pe2elf.c
index 11331294f..b686f0c82 100644
--- a/util/grub-pe2elf.c
+++ b/util/grub-pe2elf.c
@@ -341,6 +341,7 @@ write_reloc_section (FILE* fp, const char *name, char *image,
       shdr[i].sh_offset = offset;
       shdr[i].sh_link = symtab_section;
       shdr[i].sh_addralign = 4;
+      shdr[i].sh_flags = SHF_INFO_LINK;
       shdr[i].sh_entsize = sizeof (elf_reloc_t);
       shdr[i].sh_size = num_rels * sizeof (elf_reloc_t);
 
-- 
2.49.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

      parent reply	other threads:[~2025-05-01 20:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-01 20:34 [PATCH 0/3] Fix mingw compilation Vladimir Serbinenko
2025-05-01 20:34 ` [PATCH 1/3] Fix error when cross-compiling for windows from unix-like OS Vladimir Serbinenko
2025-05-01 20:34 ` [PATCH 2/3] compiler-rt: Add pei386_runtime_relocator stub Vladimir Serbinenko
2025-05-01 20:34 ` Vladimir Serbinenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250501203527.725790-4-phcoder@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.