public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Noah Goldstein <goldstein.w.n@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Jan Beulich <jbeulich@suse.com>, Fangrui Song <i@maskray.me>,
	binutils@sourceware.org
Subject: Re: [PATCH 1/4] ld: Add --text-section-ordering-file FILE
Date: Mon, 22 Jan 2024 18:22:39 +0000	[thread overview]
Message-ID: <CAFUsyfJFj+wMMgAME-=qbEhzxhPmM7yWWT-ZdFuUY5O4X-Tc3w@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOqz1WtKFcDuWrG7e-qjCH0TMYMveW+=Eyiv_w2bip1KRQ@mail.gmail.com>

On Mon, Jan 22, 2024 at 12:52 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Sun, Jan 21, 2024 at 11:37 PM Jan Beulich <jbeulich@suse.com> wrote:
> >
> > On 20.01.2024 00:15, Fangrui Song wrote:
> > > It is a shame that the new feature only applies to .text . Data
> > > sections and other code sections should be reorderable as well.
> >
> > I second this remark. In fact I wonder why it is that text needs
>
> The perf data usually provides guidance for text section layout.
>
> > treating specially here. Can't the option just be
> > --section-ordering-file and then permit covering all kinds of
> > sections?

Another issue with this approach is that it won't work for custom
linker scripts (because the `INCLUDE` of the ordering file has
been manually inserted in the defaults).

A different approach for this patch that may alleviate both concerns
(work for custom linker scripts + for arbitrary sections) would be to
update the logic of `section: NAME` in `ldgram.y`.

We could insert the script contents upon entering any new section.

This might blowup link time (if a link script is inserted at each section),
so we could add another auxiliary option to specify which sections
the config script should apply for and make it default to something like
`.data` and `.text`.
>
> It requires much bigger changes to ld.
>
>
> --
> H.J.

  reply	other threads:[~2024-01-22 18:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-19 19:45 [PATCH 0/4] " H.J. Lu
2024-01-19 19:45 ` [PATCH 1/4] " H.J. Lu
2024-01-19 21:50   ` Fangrui Song
     [not found]   ` <DS7PR12MB5765A2B98C7E1217F8C374B9CB702@DS7PR12MB5765.namprd12.prod.outlook.com>
2024-01-19 22:13     ` H.J. Lu
2024-01-19 23:15       ` Fangrui Song
2024-01-22  7:37         ` Jan Beulich
2024-01-22 12:51           ` H.J. Lu
2024-01-22 18:22             ` Noah Goldstein [this message]
2024-01-22 18:45               ` H.J. Lu
2024-01-24 14:41                 ` H.J. Lu
     [not found]       ` <DS7PR12MB5765059CCA55EC755F8132ACCB702@DS7PR12MB5765.namprd12.prod.outlook.com>
2024-01-20 14:12         ` H.J. Lu
2024-01-19 19:45 ` [PATCH 2/4] ld: Include the text section order file in all ELF linker scripts H.J. Lu
2024-01-19 20:00   ` Noah Goldstein
2024-01-19 20:18     ` H.J. Lu
2024-01-19 20:38       ` Noah Goldstein
2024-01-19 20:40         ` H.J. Lu
2024-01-19 21:07           ` Noah Goldstein
2024-01-19 19:45 ` [PATCH 3/4] ld: Include the text section order file in PE COFF " H.J. Lu
2024-01-19 19:45 ` [PATCH 4/4] ld: Document --text-section-ordering-file FILE H.J. Lu

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='CAFUsyfJFj+wMMgAME-=qbEhzxhPmM7yWWT-ZdFuUY5O4X-Tc3w@mail.gmail.com' \
    --to=goldstein.w.n@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=i@maskray.me \
    --cc=jbeulich@suse.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).