riscv-software-src / riscv-isa-sim

Spike, a RISC-V ISA Simulator
Other
2.3k stars 819 forks source link

LOAD_ELF in elf_loader.cc not handling correctly case where p_offset<sizeof(ehdr)+sizeof(phdr) #1038

Open MarkHillHuawei opened 2 years ago

MarkHillHuawei commented 2 years ago

I am seeing situations where the elf header and program header are being loaded in to the memory image, this occurs when the p_offset for a program header entry is, for example, 0. If you use the -O verilog option on objdump you will see that if there is any overlap between p_offset and ehdr+phdr then those bytes should be ignored and not loaded into the memory image.

aswaterman commented 2 years ago

Can you submit a PR that fixes this?

MarkHillHuawei commented 2 years ago

OK I should be able to send something next week

aswaterman commented 2 years ago

Thank you!

scottj97 commented 1 year ago

Was this ever fixed? I can't find any PR that relates to this...

MarkHillHuawei commented 1 year ago

Sorry Scott,

Not had a chance to upload a suitable patch for this yet.

Mark

From: Scott Johnson @.> Sent: 08 November 2022 02:54 To: riscv-software-src/riscv-isa-sim @.> Cc: Mark Hill @.>; Author @.> Subject: Re: [riscv-software-src/riscv-isa-sim] LOAD_ELF in elf_loader.cc not handling correctly case where p_offset<sizeof(ehdr)+sizeof(phdr) (Issue #1038)

Was this ever fixed? I can't find any PR that relates to this...

— Reply to this email directly, view it on GitHubhttps://github.com/riscv-software-src/riscv-isa-sim/issues/1038#issuecomment-1306551331, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMIZLSSGO3XU5JOKEH3MHOTWHG6ELANCNFSM52V2FDFQ. You are receiving this because you authored the thread.Message ID: @.**@.>>