From: Fangrui Song <i@maskray.me>
To: Alan Modra <amodra@gmail.com>
Cc: Nick Clifton <nickc@redhat.com>,
binutils@sourceware.org, Luca Boccassi <bluca@debian.org>
Subject: Re: Output section type (READONLY)
Date: Mon, 21 Feb 2022 15:30:45 -0800 [thread overview]
Message-ID: <MWHPR1201MB0110156A651A6E7C12B2D120CB3A9@MWHPR1201MB0110.namprd12.prod.outlook.com> (raw)
In-Reply-To: <YhQaZI0Lp04HoK5G@squeak.grove.modra.org>
Thanks!
On Mon, Feb 21, 2022, 15:04 Alan Modra <amodra@gmail.com> wrote:
> On Wed, Feb 16, 2022 at 06:12:19PM -0800, Fangrui Song wrote:
> > On 2022-02-16, Nick Clifton wrote:
> > > Hi Guys,
> > >
> > > I have gone ahead and applied an update form of Fanguri's patch
> (attached).
> >
> > Thanks, this enables a proper way to set the section type in the future.
> > Hope someone implements this for gold as well since it does not
> > recognize .note* as SHT_NOTE, either.
>
> "DO NOT EDIT!" says the comment at the top of bfd-in2.h. Move the new
> type field where it belongs.
>
> PR ld/28841
> * section.c (struct bfd_section): Add type. Formatting.
> (BFD_FAKE_SECTION): Formatting.
> * bfd-in2.h: Regenerate.
>
> diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
> index 78a0a1dea42..db41e7eb7fe 100644
> --- a/bfd/bfd-in2.h
> +++ b/bfd/bfd-in2.h
> @@ -1166,11 +1166,13 @@ typedef struct bfd_section
> struct bfd_section *s;
> const char *linked_to_symbol_name;
> } map_head, map_tail;
> - /* Points to the output section this section is already assigned to, if
> any.
> - This is used when support for non-contiguous memory regions is
> enabled. */
> - struct bfd_section *already_assigned;
>
> - /* Explicitly specified section type, if non-zero. */
> + /* Points to the output section this section is already assigned to,
> + if any. This is used when support for non-contiguous memory
> + regions is enabled. */
> + struct bfd_section *already_assigned;
> +
> + /* Explicitly specified section type, if non-zero. */
> unsigned int type;
>
> } asection;
> @@ -1356,7 +1358,7 @@ discarded_section (const asection *sec)
> (struct bfd_symbol *) SYM, &SEC.symbol, \
> \
> /* map_head, map_tail, already_assigned, type */ \
> - { NULL }, { NULL }, NULL, 0 \
> + { NULL }, { NULL }, NULL, 0 \
> \
> }
>
> diff --git a/bfd/section.c b/bfd/section.c
> index 2de7dbf661a..9a1071454f5 100644
> --- a/bfd/section.c
> +++ b/bfd/section.c
> @@ -551,9 +551,14 @@ CODE_FRAGMENT
> . struct bfd_section *s;
> . const char *linked_to_symbol_name;
> . } map_head, map_tail;
> -. {* Points to the output section this section is already assigned to, if
> any.
> -. This is used when support for non-contiguous memory regions is
> enabled. *}
> -. struct bfd_section *already_assigned;
> +.
> +. {* Points to the output section this section is already assigned to,
> +. if any. This is used when support for non-contiguous memory
> +. regions is enabled. *}
> +. struct bfd_section *already_assigned;
> +.
> +. {* Explicitly specified section type, if non-zero. *}
> +. unsigned int type;
> .
> .} asection;
> .
> @@ -738,7 +743,7 @@ CODE_FRAGMENT
> . (struct bfd_symbol *) SYM, &SEC.symbol, \
> . \
> . {* map_head, map_tail, already_assigned, type *}
> \
> -. { NULL }, { NULL }, NULL, 0
> \
> +. { NULL }, { NULL }, NULL, 0 \
> . \
> . }
> .
>
> --
> Alan Modra
> Australia Development Lab, IBM
>
prev parent reply other threads:[~2022-02-21 23:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-29 7:45 Fangrui Song
2022-01-29 16:46 ` Luca Boccassi
2022-01-29 18:51 ` Fangrui Song
2022-01-31 13:33 ` Nick Clifton
2022-02-01 3:39 ` Fangrui Song
2022-02-01 11:07 ` Nick Clifton
2022-02-01 11:59 ` Luca Boccassi
2022-02-02 7:29 ` Fangrui Song
2022-02-02 16:54 ` Michael Matz
2022-02-02 18:12 ` Luca Boccassi
2022-02-16 17:38 ` Nick Clifton
2022-02-16 19:03 ` Luca Boccassi
2022-02-17 2:12 ` Fangrui Song
2022-02-21 23:04 ` Alan Modra
2022-02-21 23:30 ` 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=MWHPR1201MB0110156A651A6E7C12B2D120CB3A9@MWHPR1201MB0110.namprd12.prod.outlook.com \
--to=i@maskray.me \
--cc=amodra@gmail.com \
--cc=binutils@sourceware.org \
--cc=bluca@debian.org \
--cc=nickc@redhat.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).