git: test/nvmm/demo: Fix ELF load/mmap issue on DragonFly

Aaron LI aly at crater.dragonflybsd.org
Tue Jul 20 16:30:25 PDT 2021


commit f2252fff15e614477b9361f1e13c890db0c28e9d
Author: Aaron LI <aly at aaronly.me>
Date:   Sun Jun 6 12:02:25 2021 +0800

    test/nvmm/demo: Fix ELF load/mmap issue on DragonFly
    
    The 'smallkern' ELF built on DragonFly has a zero-sized GNU_STACK
    segment, which causes mmap() to fail (EINVAL).  Add conditionals
    in elf_parse() to ignore such a segment (while also check for
    unsupported non-LOAD segments).
    
    Now 'toyvirt' correctly loads the 'smallkern' ELF on DragonFly.
    
    In addition, assert in toyvirt_mem_add() that the size must be
    greater than zero.

Summary of changes:
 test/nvmm/demo/toyvirt/elf.c  | 10 ++++++++++
 test/nvmm/demo/toyvirt/main.c |  6 ++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f2252fff15e614477b9361f1e13c890db0c28e9d


-- 
DragonFly BSD source repository


More information about the Commits mailing list