This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Prelinking on ARM
- From: Torsten Polle <Torsten dot Polle at gmx dot de>
- To: Mark Wielaard <mjw at redhat dot com>
- Cc: systemtap at sourceware dot org
- Date: Thu, 4 Jun 2015 22:42:10 +0200
- Subject: Re: Prelinking on ARM
- Authentication-results: sourceware.org; auth=none
- References: <m28uc36tyi dot fsf at gmx dot de> <1433269681 dot 4538 dot 237 dot camel at bordewijk dot wildebeest dot org> <3FE8FEB6-F65B-4F42-A963-30B8D216262B at gmx dot de> <1433323679 dot 4538 dot 242 dot camel at bordewijk dot wildebeest dot org>
Mark,
Mark Wielaard writes:
> On Tue, 2015-06-02 at 22:29 +0200, Torsten Polle wrote:
>> Am 02.06.2015 um 20:28 schrieb Mark Wielaard <mjw@redhat.com>:
>>> On Mon, 2015-06-01 at 22:43 +0200, Torsten Polle wrote:
>>>> I've a problem with prelinked shared and non-prelinked debug information
>>>> for the same on ARM. The relative offset to the .text section differs
>>>> for the prelinked shared library and the non-prelinked debug
>>>> information. SystemTap only compensates for the difference in the start
>>>> addresses. I tried to debug the problem, but I've to admit that the
>>>> problem is well over my head. Could someone give me a hint on this
>>>> matter?
>>>
>>> Does the testsuite/systemtap.exelib/exelib.exp test work for you?
>>
>> I've to check. I'm using a cross compile environment, i.e. I only run
>> passes 1 - 4 on my host (X86) and execute staprun on my target
>> (ARM). I could provide a small shared library as an example instead.
> I must admit to not have much experience with the
> cross-compiling/cross-stapping mechanism. If you could provide a
> small shared library (plus separate debuginfo file?) and the stap
> invocation that doesn't work correctly that would be helpful for
> understanding what goes wrong.
I tried to pull together a small example. But so far I failed.
Therefore I please allow me to summarise my understanding of the
situation.
prelinked debug information
+----------------------+ +----------------------+
| ... | | ... |
+----------------------+ +----------------------+
| .rel.dyn size = 0x20 | | .rel.dyn size = 0x10 |
+----------------------+ +----------------------+
| ... | | ... |
+----------------------+ +----------------------+
| .text | | .text |
+----------------------+ +----------------------+
The relocations of type R_ARM_RELATIVE in section ".rel.dyn" change
their type from REL to RELA, thereby increasing the size of the section ".rel.dynâ.
Consequently the offset of the ".text" section differs. The value of
variables (elf, module) bias in tapset.cxx only seem to take into
account that the difference between the start address of the prelinked
library and the start of the debug information is the same as the difference
between the ".text" section in both files. Alas this is not the case as
section ".rel.dyn" has changed.
If the load address of the prelinked library is 0x4000000, the address of the section â.text "might be 0x40000120, whereas the address of the section â.textâ in the debug information is 0x00000110. The bias is always calculated as 0x40000000. All probes in the .text section have a wrong offset by 0x10.
I hope this provides some insight into the problem. I'll continue my
attempts to provide a small example in the meantime.
> BTW. Which versions of systemtap and elfutils does stap -V give you?
> $ stap -V
> Systemtap translator/driver (version 2.7/0.161, rpm 2.7-1.fc22)
> the stap version -^ ^- the elfutils version
The versions I used for my current tests are:
Systemtap translator/driver (version 2.7/0.160, commit release-2.6-199-gd26e62cd8b30)
Systemtap translator/driver (version 2.8/0.160, commit release-2.7-166-gae0db08baa54)
> Thanks,
> Mark
Thanks,
Torsten