This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Prelinking on ARM with Debug Link


Hi Mark,

I reported an issue with prelinking before. While I was able to solve my issue with your help before, I got stuck with my current issue. As you might remember, Iâm using a cross compile environment, i.e. my host is a X86 64bit machine, while my target is a 32bit ARM machine (Freescale i.MX6).

Here I have a problem to compile my probes when I want to include unwind information.

The error message is as follow:

In file included from /tmp/stap/taptrek_src.c:6010:0:
/tmp/stap/stap-symbol.h:95831:1: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
 },
 ^

The offending line in stap-symbols.h looks as follows:
.sec_load_offset = 0xffffffffffffebc0 /* 4dec8000 4dec9440*/

The line includes debug output, because I checked the code in translate.cxx that generates this output and wanted to understand what is going wrong.

                  Dwarf_Addr dwbias = 0;
                  dwfl_module_getdwarf (m, &dwbias);
                  c->output << ".sec_load_offset = 0x"
                                    << hex << debug_frame_off - dwbias << dec
                                    << "/* "  << hex << debug_frame_off << " " << dwbias << dec << "*/"
                                    << "\n";

As I use a 64bit host, the hex value is given as 64bit long hex value. Additional the value is very large, because the value is actually the difference between debug_frame_off=0x4dec8000 and dwbias=0x4dec9440. As dwbias is larger than debug_frame_off, the value becomes negative. But the field .sec_load_offset as unsigned long and therefore does not take negative values.

I use a stripped and prelinked library on the target. The same library is available on the host as well. The debug link in the library points then to a non-prelinked file with the debug information. This works fine for most cases. E.g. I can set user space probe points. Only when I include the unwind information, this phenomenon occurs.

The offset of the .text section in the non-prelinked library is 0x15c40. 
The offset of the .text section in the prelinked library is 0x4decf080 - 0xdeb8000 = 0x17080.

This means that .sec_load_offset is exactly the difference 0x15c40 - 0x17080 ~ 0xffffffffffffebc0.

I wonder how I can overcome this situation.

Kind Regards,
Torsten

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]