This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils 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]

Re: [RFC] elfutils: Checks for debuginfo file without .debug extension as well


Hi Mark,

Thanks for reviewing. Please find my comments.

On Tuesday 16 February 2016 10:15 PM, Mark Wielaard wrote:
> Hi Ravi,
>
> On Tue, 2016-02-16 at 21:51 +0530, Ravi Bangoria wrote:
>> Elfutils, looking for kernel debuginfo file, tries to find it at
>> various places. If elfutils finds /boot/vmlinu*x* file, it checks
>> for debufginfo section. If debuginfo is not present, it saves it as
>> 'main elf' and continue looking for debuginfo file having .debug
>> extension i.e. vmlinux-RELEASE.debug.
>>
>> 'Ubuntu on powerpc' installs kernel as /boot/vmlinux and installs
>> debuginfo without any extension as /usr/lib/debug/boot/vmlinux-RELEASE
>> and hence, elfutils is not able to find the debuginfo file.
>>
>> Here is the lunchpad bug for the same:
>>    https://bugs.launchpad.net/ubuntu/+source/systemtap/+bug/1537125
>>
>> This patch adds functionality to search for file without any extension
>> followed by searching file having .debug extension.
> Thanks for the analysis. I do have a question though.
>
> The reason we are looking for the vmlinux-3.13.0-76-generic.debug
> filename instead of the plain vmlinux-3.13.0-76-generic filename seems
> to be because /boot/vmlinux contains a .gnu_debuginfo link with the name
> of the debug file. But that name doesn't match?

So I should put it this way:

'Ubuntu on powerpc' installs 'stripped' kernel 'without compressing it'
as /boot/vmlinux. Most of the time it's assumed that vmlinux will have
.debuginfo of .debuglink section. But this is not true here. See outputs
below.

> What does eu-readelf --strings=.gnu_debuglink /boot/vmlinux* say?

# eu-readelf --strings=.gnu_debuglink /boot/vmlinux*

/boot/vmlinux:

eu-readelf:
section '.gnu_debuglink' does not exist

/boot/vmlinux-3.13.0-76-generic:

eu-readelf:
section '.gnu_debuglink' does not exist

/boot/vmlinux-4.2.0-27-generic:

eu-readelf:
section '.gnu_debuglink' does not exist

/boot/vmlinux.old:

eu-readelf:
section '.gnu_debuglink' does not exist

> Would it make sense to not put in the "correct" (without .debug suffix)
> debugfile name in .gnu_debuglink

Yes, that should solve the problem. But changing structure of ubuntu
kernel elf to solve stap problem doesn't look feasible to me. IIRC no
other distro do that. I've confirmed this on RHEL. RHEL distro-kernel
does not have .debuglink section.

Then you may ask how this is working in RHEL then. RHEL / Fedora on
powerpc installs stripped uncompressed kernel as /boot/vmlinuz.
elfutils looking for vmlinux, doesn't find it from /boot/, so it continue
looking for file without any suffix(.debug) and it gets proper file. This is
the case with ubunut x86 as well, except on x86, /boot/vmlinuz is
compressed stripped image.

So I thought about this solution as well, renaming /boot/vmlinux to
/boot/vmlinuz will solve the problem. But this is not appropriate. Because
vmlinu*z* is for compressed image and we are just renaming file without
compressing to solve stap problem.

>   or completely leaving .gnu_debuginfo
> out (or is nothing found then?)

Not sure what does this mean. Can you please explain a bit more.

Regards,
Ravi

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