openrisc / or1ksim

The OpenRISC 1000 architectural simulator
GNU General Public License v3.0
69 stars 43 forks source link

Elf loader fixes #24

Closed stffrdhrn closed 1 year ago

stffrdhrn commented 1 year ago

As per investigation from this gist https://gist.github.com/stffrdhrn/acda47a6628e3971e84f7a4fe80f006f

The elf loader code in or1ksim was not loading init_array and fine_array sections. This is because it was only loading progbit sections. This series updates the elf loader code to load segments by program header to fix this. We still fall back to section loading if there are no program headers, which may happen in really old/odd binaries.