Output section type (READONLY)
Fangrui Song
i@maskray.me
Sat Jan 29 18:51:04 GMT 2022
On Sat, Jan 29, 2022 at 8:46 AM Luca Boccassi <luca.boccassi@gmail.com> wrote:
>
> > [PATCH v2] ld: add READONLY attribute for SECTIONS
> > (https://sourceware.org/pipermail/binutils/2021-July/117492.html)
> > added
> > READONLY. There was no justification as to why it was added.
>
> It was already explained - READONLY is necessary for notes, otherwise
> they are marked as writable:
>
> [ 3] .note.package NOTE 00000000000002e8 000002e8
> 0000000000000030 0000000000000000 WA 0 0 4
In GNU ld, SHT_NOTE special sections don't have the SHF_WRITE flag.
I don't see how READONLY is necessary.
If in some case a SHT_NOTE section has the SHF_WRITE flag,
it more likely suggests an unknown bug which should not be papered over by
adding READONLY.
> > What went lucky is that
> > https://sourceware.org/binutils/docs/ld/Output-Section-Type.html does
> > not have
> > the feature listed yet, so hopefully very few people will be lured to
> > use this.
>
> The documentation update is already committed in the repository, I
> imagine it will be published on the website after the new release is
> out.
>
> --
> Kind regards,
> Luca Boccassi
More information about the Binutils
mailing list