public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Tom Kacvinsky <tkacvins@gmail.com>, Binutils <binutils@sourceware.org>
Subject: Re: Question about readelf output from shared library built with lld, gold, and bfd linkers
Date: Tue, 22 Nov 2022 11:20:20 +0000	[thread overview]
Message-ID: <6f68fea7-9d5f-fa95-71b0-a36dda71ef2a@redhat.com> (raw)
In-Reply-To: <CAG_eJLcYkaC_UP5YXxZF8JFnwGjC9d_SnWAfEgxMAq2rYO2KXA@mail.gmail.com>

Hi Tom,

> I do not know
> where to start looking to figure out why lld generates the final ELF file
> that runs quicker than what is generated by the gold linker.

Are we talking about application start-up times or application run-time
performance ?  The two are different and likely to be affected by different
changes in the linker.

[As an aside have you also compared performance when linking with the BFD
based linker, and with mold ?)


> So, I guess the next question is this - what should I look for in the files
> generated by lld and gold, respectively, using  readelf?

You don't.  At least that is not where I would start.  Your best bet is to
use one or more profiling tools and figure out why one version of the
application is faster than the other.  If it is a case that the profiles of
the two versions are basically the same - ie they spend the same percentages
of their time in the same functions - then the cause is likely to be the
layout of the code.  The faster performing code is getting better performance
from the cache.  If they have different profiles, then maybe one linker is
able to discard more unneeded code, or optimize the linked code more effectively.

Another place to look is in the changelogs/reflogs/announcements for the
two linkers.  Likely lld has recently had some new features/improvements added
to it, and these are causing the performance improvements.

Cheers
   Nick

PS.  Waiving my devil's advocate flag here: why bother with this search ?
   Isn't it enough that you have found a linker that provides better performance ?




      reply	other threads:[~2022-11-22 11:20 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
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 [this message]

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=6f68fea7-9d5f-fa95-71b0-a36dda71ef2a@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=tkacvins@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).