anjiahao1 opened a new pull request, #15527:
URL: https://github.com/apache/nuttx/pull/15527

   arch/risc-v/src/common/riscv_addrenv.c:418:
   
   {
   ...
     database = resvbase + MM_PGALIGNUP(resvsize) + ARCH_DATA_RESERVE_SIZE;
   ...
   }
   
   if not add MM_PGALIGNUP(resvsize), will mismatch address load .data section
   
   ## Summary
   
   risc-v:fix modlib load exe elf data section mismatch
   
   ## Impact
   
   risc-v elf load
   
   ## Testing
   
   risc-v:knsh with hello apps:
   
   ```
   static char test_static[] = "Testing Static Var";
   
   int main(int argc, FAR char *argv[]) {
     printf("test_static=%s\n", test_static);
     printf("Address of test_static=%p\n", test_static);
     return 0;
   }
   ```
   
   and output:
   
   ```
   NuttShell (NSH) NuttX-12.7.2-vela
   nsh> hello
   test_static=Testing Static Var
   Address of test_static=0xc0101200
   nsh> QEMU: Terminated
   
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to