|
From: Tom H. <to...@co...> - 2005-11-15 16:49:10
|
In message <200...@gm...>
Josef Weidendorfer <Jos...@gm...> wrote:
> Thanks everybody.
>
> On Tuesday 15 November 2005 12:38, Julian Seward wrote:
>> Yes. VG_(am_find_nsegment) is what you need to call -- this should match
>> (almost) exactly the current state of /proc/self/maps.
>
> Fine.
> So how do I detect that this is in the GOT of some DSO?
Dunno ;-)
> VG_(find_seginfo) will give no SegInfo.
> So I use VG_(am_find_nsegment), and see that the returned
> segment has the DSO associated (SkFileC).
>
> I just saw that only ld.so has this problem (not returning a SegInfo).
Only the text segment will normally have a SegInfo - the full rules
can be found in VG_(di_notify_mmap) in m_debuginfo/symtab.c but it
looks like:
ok = (seg->kind == SkFileC || (seg->kind == SkFileV && allow_SkFileV))
&& seg->offset == 0
&& seg->fnIdx != -1
&& seg->hasR
&& seg->hasX
&& !seg->hasW
&& is_elf_object_file( (const void*)seg->start );
So it has to be a file mapping at offset zero in the file that has read
and execute permission but not write permission. It also needs to look
like an ELF file.
So the data segment of ld.so is ruled out both because it is not at
offset zero and because it has write permission.
> Quite strange.
> For all other DSOs, I get e.g. the following call tree:
>
> > call_init(0x2020202E, 0x2020202E, ...) [ld-2.3.5.so / 0xB5D0]
> .> 0x04027528(0x2020202E, 0x2020202E, ...) [??? / 0x4027528]
> .> 0x00004500(0x2020202E, 0x2020202E, ...) [libpthread-2.3.5.so / 0x4500]
> . > 0x00004530(0x2020202E, 0x2020202E, ...) [libpthread-2.3.5.so / 0x4530]
> . > 0x00021160 [GOT](0x2020202E, 0x2020202E, ...) [libpthread-2.3.5.so / 0x21160]
>
> And at 0x00021160 in libpthread-2.3.5.so, I have the blrl again.
Where does that [GOT] marker come from? What is the logic that
triggers it?
> Another question is why VG_(get_fnname) can not see the function name
> for libpthread-2.3.5.so:0x4500 and 0x4530. objdump and nm get them both
> fine: 4500 is _init, 4530 is call_initialize_minimal...
Which objdump/nm option? static or dynamic symbol table? or both?
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|