qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] linux-user/elfload: Fix handling of pure BSS segments
@ 2020-11-18 16:52 Stephen Long
  2020-11-24 17:32 ` Richard Henderson
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Stephen Long @ 2020-11-18 16:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: philippe.mathieu.daude, mjt, richard.henderson, laurent, ben

qemu-user fails to load ELFs with only BSS and no data section

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Stephen Long <steplong@quicinc.com>
---

Submitting this on behalf of Ben Hutchings. Feel free to edit the commit
msg.

 linux-user/elfload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 0b02a92602..af16d94c61 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -2783,7 +2783,7 @@ static void load_elf_image(const char *image_name, int image_fd,
              * segment, in that case just let zero_bss allocate an empty buffer
              * for it.
              */
-            if (eppnt->p_filesz != 0) {
+            if (vaddr_len != 0) {
                 error = target_mmap(vaddr_ps, vaddr_len, elf_prot,
                                     MAP_PRIVATE | MAP_FIXED,
                                     image_fd, eppnt->p_offset - vaddr_po);
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-12-17 10:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-18 16:52 [PATCH] linux-user/elfload: Fix handling of pure BSS segments Stephen Long
2020-11-24 17:32 ` Richard Henderson
2020-11-24 17:38 ` Peter Maydell
2020-11-24 18:47 ` Stephen Long
2020-11-25  9:39   ` Alex Bennée
2020-12-02 17:44     ` Peter Maydell
2020-12-01 20:09 ` Stephen Long
2020-12-02 13:29   ` Alex Bennée
2020-12-02 17:14 ` Stephen Long
2020-12-17  9:41 ` Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).