[Ltrace-devel] ltrace v0.7.0-git: Session on a Freetz MIPSEL router box

Edgar E. Iglesias edgar.iglesias at gmail.com
Mon Oct 8 14:52:58 UTC 2012


On Fri, Oct 05, 2012 at 04:08:34PM +0200, Petr Machata wrote:
> "Jackie Yeh [?????????]" <jackieontravel at gmail.com> writes:
> 
> > Per my private conversation with Sedat, the latest ltrace version
> > (0.7.0-gitf97b187) workw fine on his side with freetz.
> >
> > However in my environment this version for MIPSEL STB still doesn't
> > work. Here is some running log:
> 
> > DEBUG: breakpoints.c:366: breakpoints_init(pid=957)
> > DEBUG: ltrace-elf.c:339: do_init_elf(filename=/proc/957/exe)
> > DEBUG: ltrace-elf.c:340: Reading ELF from /proc/957/exe...
> > DEBUG: ltrace-elf.c:496: /proc/957/exe 4 PLT relocations
> > DEBUG: ltrace-elf.c:508: do_close_elf()
> > DEBUG: proc.c:807: proc_add_breakpoint(pid=957, (null)@0x400640)
> > DEBUG: dict.c:158: dict_find_entry()
> > DEBUG: dict.c:98: dict_enter()
> > DEBUG: dict.c:124: new dict entry at 0x4e2eb8[528]: (0x400640,0x4bc548)
> > DEBUG: breakpoint.c:85: enable_breakpoint: pid=957, addr=0x400640, symbol=(null)
> > DEBUG: breakpoint.c:48: arch_enable_breakpoint: pid=957, addr=0x400640, symbol=(null)
> > DEBUG: proc.c:733: added library a.out_freetz at 0x400000 (./a.out_freetz) to 957
> 
> So you have 4 PLT relocations, but then no breakpoints are enabled.
> Strange.  Of course on MIPS we create them delayed, but...
> 
> > DEBUG: events.c:334: event: BREAKPOINT: pid=957, addr=0x400640
> 
> e_entry breakpoint hits, and this should eventually lead to
> arch_dynlink_done, which, on MIPS, enables those symbols.  But before
> that happens, we need to crawl linkmap:
> 
> > DEBUG: dict.c:132: dict_remove(0x400640)
> > DEBUG: proc.c:566: linkmap_init()
> > DEBUG: proc.c:324: find_dynamic_entry()
> > DEBUG: proc.c:522: load_debug_struct
> > DEBUG: breakpoints.c:73: address2bpstruct(pid=957, addr=0x400640)
> 
> This doesn't look right.  We should see insert_breakpoint with address
> of r_debug.r_brk.  We don't know the details, because -D71 is not
> enough, -D77 is necessary for that (this is undocumented :-/ ).
> 
> So, ltrace finds DT_DEBUG, and tries to load_debug_struct, but then
> presumably umovebytes fails.  Somone would need to look at this on live
> machine.  The following patch might be of help in figuring out what
> happened:

Thanks,

the issue with DT_DEBUG is that MIPSEL dynamic linkers don't fill
 it out. Instead they use another tag. Finding the linker map will
need to be done in an arch specific way. I've got wip patches for this
that I'll post during the week.

There are more issues with the freetz binaries though. As I meantioned before
the compiler is generating code with the non-pic extensions to the
ABI. I've got a mipsel linux system running on QEMU built with the
freetz toolchain now. I'll post wip patches that improve this also.

Best regards,
Edgar



More information about the Ltrace-devel mailing list