public inbox for
 help / color / mirror / Atom feed
From: Tom de Vries <>
To: "LV, XIAN" <>
Cc: "" <>
Subject: Re: Hi Tom , May I ask two questions about gdb compiling
Date: Mon, 3 May 2021 08:35:30 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <9E8E160C0BCE694BA44854DA190BB1C41FC46B61@CN-EX-MB-002.NCIC.local>

[ CC-ing gdb mailing list ]

On 5/3/21 7:26 AM, LV, XIAN wrote:
> Dear Tom,
>     Sorry for disturbing.
>     Now I try to compile the gdb-10.2 which downloaded from official
> website and the compiling is successful.
>>>>./configure --target=aarch64-linux-gnu --host=aarch64-linux-gnu
> --build=x86_64-linux-gnu --prefix=/home/rex/gdb-10.2
> But there are two questions:
> *1.  How can I modify the path of dynamic interpreter:*
> rex@rex-desktop:/project/gdb-10.2/build$ file gdb/gdb
> gdb/gdb: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux),
> dynamically linked, interpreter */lib/,* for
> GNU/Linux 3.7.0, BuildID[sha1]=1f80eff7276d6bb5ee3482675502770887a210f2,
> with debug_info, not stripped
> from */lib/ to /system/bin/linker64*


I did the following experiment:
$ gcc ~/hello.c -g
$ ldd ./a.out (0x00007ffe353ca000) => /lib64/ (0x00007f7bebbdb000)
        /lib64/ (0x00007f7bebf96000)
$ /lib64/ --list ./a.out (0x00007ffd02126000) => /lib64/ (0x00007f88ba87f000)
        /lib64/ (0x00007f88bac3a000)
$ /lib64/ --list ./a.out (0x00007ffe875fb000) => /lib64/ (0x00007f6588a61000)
        /lib64/ => /lib64/

So, ISTM that you can override the dynamic linker used by adding it on
the command line before the command you're trying to run.

> *2. How can I compile the gdb tools with all dynamic library included in
> the gdb execution file (Just use the libraries in static way)*
>     Thank you so much.

No idea.  It may be possible.  OTOH, it may be a better idea to look
into concepts like containers, if your actual concern is to be able to
package an executable with all its dependencies.

[ FWIW, note btw that both your questions are more related to using
linux than to gdb itself.  So perhaps you'll able to find more or more
elaborate answers to your questions in the generic information available
for linux. ]

- Tom

           reply	other threads:[~2021-05-03  6:35 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <9E8E160C0BCE694BA44854DA190BB1C41FC46B61@CN-EX-MB-002.NCIC.local>]

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:

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

  git send-email \ \ \ \ \

* 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).