Git Product home page Git Product logo

Comments (2)

jerryz123 avatar jerryz123 commented on July 19, 2024

Spike specifies the symbol table in the ELF file to figure out how to write the target binary into its main memory region.
You may want to check that your ELF has that address is in a PT_LOAD segment.

Btw, Spike figures out the start PC from the ELF by looking at the e_entry field in the header. You don't have to use --pc to override the start pc if e_entry already points to the address you want

from riscv-isa-sim.

lovisXII avatar lovisXII commented on July 19, 2024

Thanks for the answer I did not know about the PT_LOAD
Yes but I use the programm for other purpose that just spike and I don't want to modify all my sections.
I have modified my section as followed :

Elf file type is EXEC (Executable file)
Entry point 0x80001000
There are 2 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0xc0000000 0xc0000000 0x02078 0x02078 R E 0x1000
  LOAD           0x000000 0x00000000 0x80000000 0x00074 0x00074 R E 0x1000

 Section to Segment mapping:
  Segment Sections...
   00     .text .tohost 
   01     

But when I look into address 0x80000000 it is still empty, btw my linker look like this :

seg_reset   = 0x80001000;
seg_user    = 0xC0001000;
ENTRY(_reset)

PHDRS
{
user PT_LOAD FILEHDR PHDRS FLAGS(5);
system PT_LOAD FILEHDR PHDRS AT(seg_reset - 0x1000) FLAGS(5);
}

SECTIONS
{
. = seg_reset;
.reset : { *(.reset) } : system
. = ALIGN(0x1000);
.kernel : { *(.kernel) } : system
. = ALIGN(0x1000);
.exit   : { *(.exit) } : system

. = seg_user;
.text         : { *(.text) } : user
. = ALIGN(0x1000);
.tohost       : { *(.tohost) }
. = ALIGN(0x1000);
.data         : { *(.data) }
.data.string  : { *(.data.string)}
.bss          : { *(.bss) }
_end = .;

}

from riscv-isa-sim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.