public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Kalamatee <kalamatee@gmail.com>, binutils@sourceware.org
Subject: Re: Looking for advice for GNU debuglink generation.
Date: Tue, 26 Jan 2021 10:14:44 +0000	[thread overview]
Message-ID: <8b0ec490-52d1-b1d2-33f2-9dbfa4b9fc15@redhat.com> (raw)
In-Reply-To: <CAJWNc-4AvLez0hSFMwFqUuqSE_rYKXT7Lc=U0=akhY-fYiKvxw@mail.gmail.com>

Hi Kalamatee,

> I am looking for advice on the generation of gnu debug link information in
> binaries

A good starting place would be the source file bfd/opncls.c which contains
several functions related to separate debug information.  In particular the
find_separate_debug_file() function has heuristics for locating the debug
files.

> The problem we have is our binaries are generated under some directory
> (e.g. /home/test/build/AROS/), which is present in the debug link
> information for all the binaries we generate. Is there some way to define a
> base path that the linker will strip when adding this?

It is the objcopy program rather than the linker which is responsible for
adding the debug links, and it strips *all* of the path components from the
filename before storing it.  (See bfd_create_gnu_debuglink_section() where
it calls lbasename).
  
> In future, we had hoped to move the generated debug information under
> <build dir>/Developer/Debug/dbg - - but again doing so doesn't work because
> it then looks for <build dir>/Developer/Debug/dbg/<biuld dir>/<relative
> path to binary>/<binary>

When you say "it looks for", what is "it" ?  If you mean the objdump program
or readelf then you may need to modify the code in the load_separate_debug_info()
function in binutils/dwarf.c.

Cheers
   Nick




  reply	other threads:[~2021-01-26 10:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26  2:46 Kalamatee
2021-01-26 10:14 ` Nick Clifton [this message]
2021-01-27 14:15 ` Michael Matz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b0ec490-52d1-b1d2-33f2-9dbfa4b9fc15@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=kalamatee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).