[Libre-soc-bugs] [Bug 1228] SFFS ISACaller userspace ELF support for dynamic linking and PIC

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Wed Dec 6 09:28:46 GMT 2023


https://bugs.libre-soc.org/show_bug.cgi?id=1228

--- Comment #12 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #9)
> my thoughts: single-stepping through the entire program under qemu
> using the Test API would give a FULL instruction AND register AND
> memory-access trace that would allow instruction-by-instruction EXACT and 
> i do mean EXACT replication such that "diff -u" tells you precisely
> and immediately the deviation.

two issues with this idea: the code we have uses qemu in system mode, in system
mode qemu doesn't emulate syscalls, so it won't match.

in user mode, qemu uses an arbitrary non-default code base address of
0x4000...something (i tried changing it, didn't seem to work), this is not at
all what happens when just running it in gdb under a ppc64le kernel. to match
qemu would require implementing relocations and figuring out what all qemu
does, and then we would match linux itself less well.

so, because of that, I'm just running under gdb with `record full` enabled:
on a ppc64le system/VM (qemu-system with a linux install works):
gdb my-program.elf
starti
record full
<change stack pointer and insert argv/envp/auxv if necessary>
c

then you can use gdb's reverse debugging features to try and find where it
matches ISACaller or not.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list