public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: Luca Boccassi <bluca@debian.org>
Cc: Fangrui Song <i@maskray.me>, binutils@sourceware.org
Subject: Re: [PATCH] ld: Support customized output section type
Date: Fri, 4 Feb 2022 16:05:29 +0000 (UTC)	[thread overview]
Message-ID: <alpine.LSU.2.20.2202041547040.3972@wotan.suse.de> (raw)
In-Reply-To: <5483e1b249b67e143c540362213625cf1dccaefb.camel@debian.org>

Hello Luca,

On Thu, 3 Feb 2022, Luca Boccassi wrote:

> I understand you don't like it, but as I've already explained again, and 
> again, and again, it is needed, and frankly I'm getting exhausted.

But it's not, you are wrong on that account.  It once was necessary until 
the problem (of generating writable sectons by default) was fixed.  There 
was only a very short time window when (READONLY) was supported _and_ 
necessary.  The bug (PR26378) got fixed in January 2021 (so 2.36 should 
have it), and since then we have:

% cat x.c
int main()
{
  return 0;
}
% cat metadata.ld
SECTIONS
{
    .note.foobar : ALIGN(4) {
        BYTE(0x42)
    }
}
INSERT AFTER .note.gnu.build-id;
% gcc x.c -Wl,-T,metadata.ld
% readelf -SW a.out | grep note
  [ 2] .note.gnu.property NOTE            0000000000400338 000338 000020 
00   A  0   0  8
  [ 3] .note.gnu.build-id NOTE            0000000000400358 000358 000024 
00   A  0   0  4
  [ 4] .note.foobar      NOTE            000000000040037c 00037c 000001 00   
A  0   0  4
  [ 5] .note.ABI-tag     NOTE            0000000000400380 000380 000020 00   
A  0   0  4
% ld -v
GNU ld (GNU Binutils; openSUSE Tumbleweed) 2.37.20211112-3

As you can see, no "(READONLY)" but still a read-only .note.foobar 
section.  (Ignore the fact that my contents of .note.foobar isn't a 
correct SHT_NOTE content)

That's what I meant with ill-advised: a feature was added to work-around 
a bug, instead of the bug being fixed.  The bug now is fixed and the 
feature is useless but needs to be kept for backward comp, except maybe 
it could be removed again if the few users could be convinced to just not 
use it anymore; so could you be convinced? :)


Ciao,
Michael.

  parent reply	other threads:[~2022-02-04 16:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02  7:10 Fangrui Song
2022-02-02 11:36 ` Nick Clifton
2022-02-02 11:46   ` Luca Boccassi
2022-02-02 18:32   ` Fangrui Song
2022-02-03 18:36     ` Luca Boccassi
2022-02-03 19:46       ` Fangrui Song
2022-02-03 20:04         ` Luca Boccassi
2022-02-03 20:48           ` Fangrui Song
2022-02-04 16:05           ` Michael Matz [this message]
2022-02-21 19:35 ` Mike Frysinger

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=alpine.LSU.2.20.2202041547040.3972@wotan.suse.de \
    --to=matz@suse.de \
    --cc=binutils@sourceware.org \
    --cc=bluca@debian.org \
    --cc=i@maskray.me \
    /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).