public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Fangrui Song <maskray@gcc.gnu.org>
To: Alan Modra <amodra@gmail.com>
Cc: binutils@sourceware.org, gcc@gcc.gnu.org,
	 Cary Coutant <ccoutant@gmail.com>
Subject: Re: CREL relocation format for ELF (was: RELLEB)
Date: Thu, 28 Mar 2024 09:26:56 -0700	[thread overview]
Message-ID: <CAN30aBGcjxs9qFcwq8Sbv7drYzHaDTdJmMQhoZ80a8PhFWPSrQ@mail.gmail.com> (raw)
In-Reply-To: <ZgVq55QY9wqNj9zx@squeak.grove.modra.org>

On Thu, Mar 28, 2024 at 6:04 AM Alan Modra <amodra@gmail.com> wrote:
>
> On Fri, Mar 22, 2024 at 06:51:41PM -0700, Fangrui Song wrote:
> > On Thu, Mar 14, 2024 at 5:16 PM Fangrui Song <maskray@gcc.gnu.org> wrote:
> > > I propose RELLEB, a new format offering significant file size
> > > reductions: 17.2% (x86-64), 16.5% (aarch64), and even 32.4% (riscv64)!
> > >
> > > Your thoughts on RELLEB are welcome!
>
> Does anyone really care about relocatable object file size?  If they
> do, wouldn't they be better off using a compressed file system?

Yes, many people care about relocatable file sizes.

* Relocation sizes affect DWARF evolution and we were/are using an
imperfect metric due to overly bloated REL/RELA. .debug_str_offsets
does not get much traction in GCC, probably partly because it needs
relocations. DWARF v5 introduced changes to keep relocations small.
Many are good on their own, but we need to be cautious of relocation
concerns causing us to pick the wrong trade-off in the future.
* On many Linux targets, Clang emits .llvm_addrsig by default to allow
ld.lld --icf=safe. .llvm_addrsig stores symbol indexes in ULEB128
instead of using relocations to prevent a significant size increase.
* Static relocations make .a files larger.
* Some users care about the build artifact size due to limited disk space.
  + I believe part of the reasons -ffunction-sections -fdata-sections
do not get more adoption is due to the relocatable file size concern.
  + I prefer to place build directories in Linux tmpfs. 12G vs 10G in
memory matters to me :)
  + Large .o files => more IO amount. This may be more significant
when the storage is remote.

      reply	other threads:[~2024-03-28 16:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-15  0:16 RELLEB relocation format for ELF Fangrui Song
2024-03-23  1:51 ` CREL relocation format for ELF (was: RELLEB) Fangrui Song
2024-03-28  7:43   ` Fangrui Song
2024-03-28  9:23     ` CREL relocation format for ELF Jan Beulich
2024-03-29  7:24       ` Fangrui Song
2024-03-28 13:04   ` CREL relocation format for ELF (was: RELLEB) Alan Modra
2024-03-28 16:26     ` Fangrui Song [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=CAN30aBGcjxs9qFcwq8Sbv7drYzHaDTdJmMQhoZ80a8PhFWPSrQ@mail.gmail.com \
    --to=maskray@gcc.gnu.org \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=ccoutant@gmail.com \
    --cc=gcc@gcc.gnu.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).