public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Tom Kacvinsky <tkacvins@gmail.com>
To: Binutils <binutils@sourceware.org>
Subject: Re: Question about readelf output from shared library built with lld, gold, and bfd linkers
Date: Mon, 21 Nov 2022 09:51:20 -0500	[thread overview]
Message-ID: <CAG_eJLdvkmQm6qLOZst4RLVcKTLDPpo0aZ4FDz6CQtiO0nFtWQ@mail.gmail.com> (raw)
In-Reply-To: <e3fc471d-ec8c-c483-11a7-3f291ffa89ce@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2195 bytes --]

On Mon, Nov 21, 2022 at 9:14 AM Nick Clifton <nickc@redhat.com> wrote:

> Hi Tom,
>
> > Isee the following output from readelf for the lld, gold and bfd linkers
> > (binutils 2.39, lld 14.0.6)
>
> To be clear - this is not a readelf problem.  It is showing you the correct
> results.  It is the fact that the three linkers are not producing identical
> output and instead showing slight variations in their layout of the linked
> binary that is bothering you, yes ?
>

It's not bothering me so much as I was wondering if this would point to an
issue with slow start up times.  Reading your reply in totality, I now see
this
should not make a difference.


> In general variations in the layout like this should not make any
> difference
> to the program#s startup time.  There might - possibly - be variations in
> performance due to affects like cache misses and the like, but this is hard
> to quantify in isolation.
>

I didn't stop to think about caching and the like for relocations at start
up.  I was
testing with the perf tool and LD_DEBUG=statistics to see how much time was
spent in start up by symbols/relocations.  Results varied from run to run,
so I can
now see how caching may play into this.

> Output below.  Notice how the ordering is different in each case.  The
> > interesting thing about this is, and why I am looking at various
> > differences between object code linked by these three linkers, is that I
> am
> > trying to track down why startup times are slower due to relocations
> (based
> > on the perf tool output).  Would any of these differences make, well, a
> > difference in startup time?
>
> I don't think so.  The number of relocations is the same, so the amount
> of start up time spent resolving them should effectively be the same as
> well.
>
> I assume that you have compared started up times when linking with "-z now"
> vs "-z lazy" ?
>

I thought -z lazy was the default, and that if you wanted the equivalent of
LD_BIND_NOW=1
on the command line, then one would use -z now.  We don't want the latter,
we already spawn
enough processes that -z now would slow things down even more.  I can try
with -z lazy and
report back.

Thanks for the input,

Tom

  reply	other threads:[~2022-11-21 14:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-20 16:37 Tom Kacvinsky
2022-11-21 14:14 ` Nick Clifton
2022-11-21 14:51   ` Tom Kacvinsky [this message]
2022-11-21 15:16     ` Nick Clifton
2022-11-21 15:33       ` Tom Kacvinsky
2022-11-21 16:48         ` Nick Clifton
2022-11-21 17:43           ` Tom Kacvinsky
2022-11-22 11:20             ` Nick Clifton

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=CAG_eJLdvkmQm6qLOZst4RLVcKTLDPpo0aZ4FDz6CQtiO0nFtWQ@mail.gmail.com \
    --to=tkacvins@gmail.com \
    --cc=binutils@sourceware.org \
    /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).